I used powershell remoting to copy a file from shared drive from one system to other system, but nothing copied. Hers is the code.
I tried to copy a file from view-xxx9 to view-xxx007. System view-xxx9 has sharefolder servicemsi and share name is msishare1. I tried\\view-xxx9\servicemsi also.
Invoke-Command -computername view-xxx007 -scriptblcok{
copy-item "\\view-xxx9\msishare1" "c:\servicemsi" -recurse
}
And also i used WMI
$file = "c:\copy.bat"
Invoke-WmiMethod Win32_process -Name Create -ArgumentList $file -ComputerName view-xxx007
Copy.bat
@echo off
robocopy "\\view-xxx9\msishare1" "c:\servicemsi"
I haved careated batch file remote system and also I got received return code 0, but nothing copied.
Dhanraj