Long story short, the access control department pushed an update that broke the user profile on about 40 Windows 7 workstations. Instead of taking the time to investigate where the break is actually located, desktop support has been tasked to manually recreate the profiles. Due to the nature of the users and the apps they use this process can take anywhere from 45 minutes or longer to accomplish. I would like to automate this process as much as possible.
I have written various small scripts to handle some of the tasks, such as backing up vital portions of the user's profiles (list of mapped drives, favorites and desktop items, etc..). But I would like to write a script that will make a copy of the old user directory and delete the registry entry for that profile so that a new fresh one is created when the user logs in.
So far this is what I have come up with.
copy c:\users\homer.simpson c:\users
set /p username=Input the username:
wmic %username% get name,sid
This syntax might be a little off (what I wrote at work, gets the desired result). My question is how do I take the sid and pipe it either to a new command or to a file that a command can parse and use.
I'm very green when it comes to scripting, so the simpler the explanation the better for me. Thanks for any help.
I have written various small scripts to handle some of the tasks, such as backing up vital portions of the user's profiles (list of mapped drives, favorites and desktop items, etc..). But I would like to write a script that will make a copy of the old user directory and delete the registry entry for that profile so that a new fresh one is created when the user logs in.
So far this is what I have come up with.
copy c:\users\homer.simpson c:\users
set /p username=Input the username:
wmic %username% get name,sid
This syntax might be a little off (what I wrote at work, gets the desired result). My question is how do I take the sid and pipe it either to a new command or to a file that a command can parse and use.
I'm very green when it comes to scripting, so the simpler the explanation the better for me. Thanks for any help.