I notice an error " Connecting to remote server usa-chicago failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic
- CategoryInfo : OpenError: (usa-chicago:String) [], PSRemotingTransportException
- FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken
". Below is the snippet used. Any suggestions?
All the machines are inside a workgroup.
$computers = gc "C:\servers.txt"
$source = "\\usa-chicago\c$\temp\one.jar"
$destination = "c$\july1\folder1\"
foreach ($computer in $computers) {
Invoke-Command -Computername $computer -ScriptBlock { & Copy-Item $using:source -Destination \\$using:computer\$using:destination -Force }
}
c$
notc:\
? – T-Metry{}catch{}
– T-MeEnable-PSRemoting
was executed on the target? ;) – T-Me