Author Posts

August 5, 2014 at 2:59 pm

I am trying to copy a file to multiple remote computers thru a pssession.

I am getting an Access is denied error

All the users have perms to acess the file share

heres the code i am using

$NewWrk = Get-QADComputer | ?  whenCreated  -gt 8/05/2014
$s = new-PSSession -computername ($NewWrk |  select -ExpandProperty name)  -ErrorAction SilentlyContinue

Invoke-Command -Session $s  -ScriptBlock { 

copy-item -Path '\\file01\ec\ITMigration\Agent.jnlp'  -Destination "$env:USERPROFILE\Desktop" 


is this the 3rd hop issue? any work around with Enable-WSManCredSSP?

thank you

August 5, 2014 at 3:03 pm

It's actually called the "second hop" issue, and yes, that's the problem. You're asking the remote machine to go to a UNC; it has no credentials to present. And yes, CredSSP would be one way to address the problem, as outlined in "Secrets of PowerShell Remoting."

You could also modify the share permissions to accept non-authenticated (anonymous) connections. That's different from "Everyone" or "All users."