Robocopy is by far the best method by far to copy files between Windows servers that I have come across while retaining the NTFS security.
You require to have the below details at hand before running the command:
- File share on the source server
- File share on the destination server
- Give Everyone Full Access to these File Shares
- Ensure the user running the script has local administrator rights on both servers
- Run powershell with admin rights and run the below command replacing your directories
robocopy \\serverSource\ShareA \\serverDestination\ShareA /MIR /COPYALL /DCOPY:T /R:1 /W:1 /NP /TEE /LOG:c:\temp\RoboCopyResults.log
Once done, you are more than welcome to check the logs for any errors while RoboCopy was copying files. The switch functions used above have been explained in further detail below:
/MIR – Creates a mirror copy.
/COPYALL – Copies ALL file attributes
/DCOPY – Copies (retains original) Directory Creation/Modified Timestamps. If you don’t include this, all directories will be recreated with NEW timestamps
/R:1 – Retry copy once on failure
/W:1 – Wait 1 second between retries
/NP – No Percentage Completion written to the output
/TEE – Output progress to Command Window
/LOG – Write out and save to a specified Log File
Thank you for reading this blog titled “Copy files between Windows Servers” and you are more than welcome to leave a comment below.