Access is Denied error

This topic contains 6 replies, has 2 voices, and was last updated by Profile photo of Boe Prox Boe Prox 3 years, 1 month ago.

  • Author
    Posts
  • #13997
    Profile photo of Simon Holman
    Simon Holman
    Participant

    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.

  • #13998
    Profile photo of Simon Holman
    Simon Holman
    Participant

    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.

  • #14002
    Profile photo of Boe Prox
    Boe Prox
    Participant

    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.

  • #14003
    Profile photo of Simon Holman
    Simon Holman
    Participant

    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.

  • #14011
    Profile photo of Boe Prox
    Boe Prox
    Participant

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

  • #14020
    Profile photo of Simon Holman
    Simon Holman
    Participant

    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.

  • #14022
    Profile photo of Boe Prox
    Boe Prox
    Participant

    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.

You must be logged in to reply to this topic.