We have a lot of ts profiles that the administrator does not have access to. So I used a simple script to take ownership of the folder, and give full access to the user, administrator and system.
When a user tries to log on, they get an error message saying it can't load user profile. A server copy with wrong permissions exists. Either the user or the administrative group must be owner.
I've tried with administrative group and administrator as owner, but still the same message. When I set the user as owner, the message disappears.
My problem is that I can't set user to owner through the batch script. Is there any command line for this? I only seem to be able to set the current logged on user or the administrative group as owner through the command line. Doing this manually is a major job....
Windows 2008 servers