Can PowerShell restore previous versions of files/folders via Volume Shadow Services (VSS)?
we working ms tech support determine why many of our students' home folders being deleted on logon in windows 7 , 2008r2. in us, there other schools around world experiencing same issue; schools unique in have large number of students passing through relatively smaller number of computers every day. premium support case, , hoping narrowing down cause; in meanwhile, have learned powershell manage situation on day-to-day basis.
i use powershell locate those deleted home folders. in our 3rd month of situation, , spend @ least hour day on home folder issues. 1 of scripts compares our active directory student users list of home folders on folder share, , tells me folders missing - run every hour, after classes begin each period. when find missing folders, restore them last non-null previous version restore previous versions (our server takes vss snapshots 3x/day), , need manually reset security of students' folder i've found student no longer has control on own folder/files, throw error on login. this manageable if i'm missing 1-2 folders; when batch of 10 or 20 come @ once, it's nightmare. small tech staff has other responsibilities, teaching , data management, , not procedure every day ... so when i'm out of office, it's harder manage. matter, *i* have lots of other responsibilities, , irks me spend time on every day!
i'd extend script more: (1) re-create home folder (easy); (2) find last previous version exists, , restore it (a complete unknown); , (3) set security give user full control of folder , child objects (manageable, think). not finding online using powershell middle step - to automate restoration of folders or file vss. possibility exist?
-pam
ohhh messy...
so, think can done. there apparently com reference vss you'd able hook in to.
http://msdn.microsoft.com/en-us/library/aa384648(vs.85).aspx
you'd either need find com name or guid , use new-object -com <name> , can use api functions documented above.
and setting ownership ps can done not straightforward. need use .net classes because set-acl wont you. know there references on web don’t know off hand.
also have turned on auditing folders see deleting them? , assume msft has gone through gpo's , login scripts pretty carefully?
Windows Server > Windows PowerShell
Comments
Post a Comment