Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Can PowerShell restore previous versions of files/folders via Volume Shadow Services (VSS)?

$
0
0

We are working with MS Tech Support to determine why many of our students' home folders are being deleted on logon in Windows 7 and 2008R2. We are in the US, but there are other schools around the world that are experiencing the same issue; schools are unique in that we have a large number of students passing through a relatively smaller number of computers every day. This is a Premium Support case, and I am hoping they are narrowing down the cause; in the meanwhile, I have learned PowerShell to help manage the situation on a day-to-day basis.

I use PowerShell to quickly locate those deleted home folders. We are in our 3rd month of this situation, and I spend at least an hour a day on home folder issues.  One of my scripts compares our Active Directory student users with the list of the home folders on the folder share, and tells me whose folders are missing - I run this every hour, usually just after classes begin each period. When I find missing folders, I restore them to the last non-null previous version with Restore Previous Versions (our server takes VSS snapshots 3x/day), and then I also need to manually reset the security of the students' folder as I've found that the student no longer has control over their own folder/files, which will throw an error on login. This is all manageable if I'm missing 1-2 folders; when I get a batch of 10 or 20 that come up all at once, it's a nightmare. My very small tech staff has other responsibilities, like teaching and data management, and they do not do this procedure every day as I do ... so when I'm out of the office, it's even harder to manage. For that matter, *I* have lots of other responsibilities, and it irks me that I spend so much time on this every day!

I'd like to extend the script to do more: (1) re-create the home folder (easy);  (2) find the last Previous Version that exists, and restore it (a complete unknown); and (3) set security to give the user full control of their folder and child objects (manageable, I think). I am not finding anything online about using PowerShell to do that middle step -to automate restoration of folders or file from VSS.  Does that possibility exist?


-Pam

Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>