Script to "reset" a profile
Posted on 2011-03-08
I'm trying to piece together a script that will do the following, and am wondering if anyone out there has a similar script they could share so I can test and hopefully use:
1. Display input box where you put a user's domain user account name
2. Confirm the name is correct, else go back to text box to re-enter
3. Take the username and make a backup of and delete a network folder (\\fs001\%username%$\Application Data\Microsoft) - the Microsoft folder backs up and deletes.
4. Take same username and make a backup of and delete all the "contents" (not the folder) of (\\fs002\profiles$\%username%) so the %username% folder still exists int he profiles$, but the contents is backed up and deleted.
5. Message saying complete. Or give an error if access to delete said folders is denied.