Access is Denied error

I created a PSSession to a Hyper-V host from my admin server while logged in as a domain administrator.

When I tried to copy a file from a share on the admin server to the local dir on the Hyper-V host, I got an Access is Denied error. The command was “copy \admin1\certs\certfile.pfx” c:\certs"

Same thing when I tried to execute a ps1 script from the share on the admin server (After enabling RemoteSigned execution policy).

I RDP’d into the server and performed both actions without any error.

I was logging on to both servers with the same domain admin credentials.

I just re-read the error and it says that “Cannot find path ‘\admin1\certs\certfile.pfx’ because it does not exist.”

I copied and pasted the same command via the RDP session and it worked.

This sounds like a “double hop” issue where you are trying to access a remote system while currently in a pssession on a different remote system. This is because the Hyper-V host will not delegate your credentials to allow access to another remote system by default. In that case, you have one of two options: Enable CredSSP on the Hyper-V server or configure Delegated Administration for the endpoint on the Hyper-V server. This is done by creating a new remote endpoint and specifying a ‘RunAs account’ that will then run all commands that you issue while in a remote pssession.

Thanks Boe. It wasn’t a Powershell “double hop”, but I was connected to my PC via RDP so I guess it could be the same thing. I’ll try it directly from my PC today and see if it works.

So this is working now? Just making sure based on the above response.

No, it’s still not working, but I think I may have done something wrong on my end with the share it’s connecting to. Everything else including making directories seems to work over this Session.

You can create directories on the remote system or locally while in the pssession? Just getting clarification.
PSsessions work differently than RDP sessions. You will not be able to access anything other than the local resources of the machine that you are in the pssession in. Attempts to access remote systems from that system you are in the pssession in will result in access denied and cannot find path errors.