I have a simple PowerShell script which copies files to a backup share. If I run this command locally, the files copy without issue. However, if I run the script from a remote computer under the same account, all steps in the script succeed until the Copy-Item command which returns “Access is denied”.
The script is being called remotely through a command of the form:
Invoke-Command -ComputerName RemoteServer -ScriptBlock {& "E:\Scripts\CopyScript.ps1" -FolderName "\\FileServer\BackupFolder"}
I have added a “Start-Transcript” command to the script and this returns the correct account name in the header but the Copy-Item fails.
Is this a double-hop authentication issue or am I missing something else? If it is a double-hop issue, is there a way around this? Note that granting “Full Control” to the target folder and target share for “Everyone” doesn’t solve the problem.
Thanks.