How to Use Robocopy Between Two Non-Domain File Servers with Different Admin Accounts?
Asked by
Loopy
I need to migrate files from an old file server to a new one using Robocopy, but there's a complication: both servers are not part of a domain and have different local users with admin rights. There's no shared local or domain account between the two. I'm looking for advice on how to authenticate Robocopy when the local admin accounts differ. Can I specify credentials directly in Robocopy, or should I temporarily create matching local admin accounts on both servers? Alternatively, would using 'net use' with alternate credentials work better? Or is there a benefit to running the copy from a third machine? Any best practices would be appreciated!
Answers
I think you can still leverage the classic feature where Windows sends the password automatically if the usernames match. If you create the same non-admin account and password on both servers, it should facilitate the transfer.
Reply to this answer
You can utilize PowerShell's 'new-psdrive' command to mount the remote share with the necessary credentials. However, be aware that if the servers are not domain-joined, NTFS permissions may get messy since they use SIDs instead of usernames for authentication.
Reply to this answer
The simplest approach is to use the 'net use' command to map the destination server as a network drive with the target credentials. This way, you can cleanly authenticate without needing to create matching accounts on both servers. Just run the command prior to your Robocopy process, and you should be good to go!
~in due course: Exactly! It's a straightforward solution and works well without complications.
Reply to this answer
Mapping a drive using 'net use' with specific credentials is definitely the way to go. Remember, for SMB connections, it's important to specify those alternate credentials to ensure the connection is secure and works properly!
Reply to this answer
Add your answer
Answers are reviewed before publication.
g8_promotion: If you're worried about NTFS rights, you can bypass copying the security features by using the '/Copy:DAT' and '/Dcopy:DAT' flags in your Robocopy command.