Author Posts

December 7, 2017 at 1:50 pm


I have a script, where I copy a file to a remote server (virtual machine).

$destination = '\\ServerName\C$\users\public\Documents'
Copy-Item $file.FullName -Destination $destination -Force

I can execute the script and get the expected result (copying the file) manually. When I register the script execution as a scheduled job however, it fails to copy the file. Am I missing credentials or something?

December 7, 2017 at 6:04 pm

What credentials are you specifying in the Scheduled Task?
They must be creds that have admin creds for all hosts where the action is to happen.

December 8, 2017 at 6:10 am

Will give it a try, thanks.