Hello,
I have setup a powershell script to do robocopy job.
I am new on robocopy and my plan is to transfer data from one server to another both on a different domain.
Since I have several folders to transfer, the way I have the script seems to do the work however I do not know how I can add the login details for the source/destination server. Here is where I am struggling. I have run the script on a pc and works fine but I need it for different server domains.
So far this is what I have
$sourcePath1 = "C:\path\my folder
$sourcePath2 = "C:\path\my folder
$destinationPath1 = 'D:\folder1\'
$destinationPath2 = 'D:\folder2enter code here\'
$filetransfer = 'C:\filetransferlog.txt'
robocopy $sourcePath1 $destinationPath1 /E /DCOPY:DAT /COPYALL /LOG:$filetransfer /MIR /TEE /W:3 /ZB /V /timfix /sl /r:7 /COPY:DAT #/BYTES
robocopy $sourcePath2 $destinationPath2 /E /DCOPY:DAT /COPYALL /LOG:$filetransfer /MIR /TEE /W:3 /ZB /V /timfix /sl /r:7 /COPY:DAT