netjets
asked on
Take Ownership of a folder - Many folders and many users
Hi Guys,
First time posting on here so I apologise if I do anything wrong or don't provide enough info.
What i need to do is simple to explain though:
My users are getting Roaming profile errors after the profile folders were moved from one server to another. The only way to stop these messages is to give ownership of the profile folder to the user (I think this is the only way). Now if a user is called user1 the folder will also be called user1. Is there a quick way to set the ownership of all the folders to the corresponding user?
I hope this makes sense. :-/
Thanks.
First time posting on here so I apologise if I do anything wrong or don't provide enough info.
What i need to do is simple to explain though:
My users are getting Roaming profile errors after the profile folders were moved from one server to another. The only way to stop these messages is to give ownership of the profile folder to the user (I think this is the only way). Now if a user is called user1 the folder will also be called user1. Is there a quick way to set the ownership of all the folders to the corresponding user?
I hope this makes sense. :-/
Thanks.
ASKER
Thanks for the super fast response.
I don't know how to write VB scripts (very well). Is there an easier way?
I don't know how to write VB scripts (very well). Is there an easier way?
You can use cacls in a batch file:
http://support.microsoft.com/kb/135268
http://support.microsoft.com/kb/135268
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the cacls command could look like this:
cacls.exe profiles\%UserName% /g administrators:f system:f %UserName%:c
cacls.exe profiles\%UserName% /g administrators:f system:f %UserName%:c
ASKER
Thanks man! Genius...Thank you all for your help :-)
You can combine it with vbscript to write a procedure....
See here:
https://www.experts-exchange.com/questions/22141356/USING-CACLS-IN-A-VBS-SCRIPT.html?sfQueryTermInfo=1+30+cacl+script
here are more infos and the download:
http://support.microsoft.com/kb/318754