I want to copy a directory(abc) from domain1/user1 to domain2/user1. any idea how to do this. e.g robocopy
robocopy \\server1\G$\testdir\%3 \\server2\g$\uploads
and both are on different domains
Robocopy will use the standard windows authentication mechanism.
So you probably need to connect to the servers using the appropriate credentials before you issue the robocopy command.
You can use net use
to do this and you could put that in a batch script.
Note that Windows doesn't like you to connect to the same server with two different sets of credentials (so you can't copy from and to the same server as different users). But that's not what it looks like you need.
Something like this:
net use \\server1\g$ /user:domain1\user1 *
net use \\server2\g$ /user:domain2\user2 *
robocopy \\server1\G$\testdir\%3 \\server2\g$\uploads
Notes:
net use
to make sure it does what you need.You can probably also remove the network connection to the servers by using this (I haven't tried this with a deviceless connection):
net use \\server1\g$ /delete
net use \\server2\g$ /delete