Albert Widjaja
asked on
How to fix directory and file ownership using Robocopy script on Windows Server 2012 R2 ?
Hi People,
Can anyone here please share me the Robocopy scipt to fix the file ownership and the directory ownership so that the owner from the source file server (Server 2008) will be the same as the target or the new file server ?
here's what I use to perform the files initially from the target server (2012 R2):
With the script above, the directory owner and the file owner is the NewServer2012R2\Administra tors (the local admin) instead of the individual users like what it says on the source file server.
one of the experts here suggest me to use this script below:
But I with the script above, the data is all overwritten again from the beginning thus making it very long to complete.
Can anyone please help me ?
Can anyone here please share me the Robocopy scipt to fix the file ownership and the directory ownership so that the owner from the source file server (Server 2008) will be the same as the target or the new file server ?
here's what I use to perform the files initially from the target server (2012 R2):
robocopy.exe "\\OldFileServer\homedirectories" F:\Users *.* /e /xo /XA:O /zb /copyall /dcopy:DAT /secfix /sec /r:0 /w:0 /np /nfl /ndl /tee /log:"C:\Temp\robocopyUser s.log"
With the script above, the directory owner and the file owner is the NewServer2012R2\Administra
one of the experts here suggest me to use this script below:
robocopy.exe "\\OldFileServer\homedirectories" F:\Users *.* /MIR /E /Z /SECFIX /SEC /XO /XJ /Z /B /ZB /COPY:DATSO /MIR /DCOPY:T /R:0 /W:0 /NP /NFL /NDL /TEE /LOG:"C:\Temp\robocopyUser s.log"
But I with the script above, the data is all overwritten again from the beginning thus making it very long to complete.
Can anyone please help me ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
So what's the command for the icacls ?
I'm newbie in this matter.
I'm newbie in this matter.
Well if other experts are recommending robocopy I'd give it a try--I am going to try it myself because takeown and icacls can be challenging to get right. Run the command I fixed and see if it results in what you wanted--this of course assumes that F:\Users has the right ownership and permissions
Glad I could help--did it fix the security issues you wanted it to?
ASKER
yes the Robocopy script that you suggested works :-)
Thanks man !
Thanks man !
ASKER
so in this case by running the script that you suggested below
it should fix the ACL and files & directory ownership without copying all data/files from the source file server ?