I'm using enter-pssession to connect to a remote machine via Powershell. I then try to run an application via this connection on the remote machine. However, when I do this, it believes the user is anonymous and I get permission errors.

I'd like the app to either run as the current user I used to remote from, or be able to provide the credentials that it can run under. I see a whole bunch of authentication options for the enter-pssession cmdlet but it's not clear to me what I need to use.

How can I accomplish this?

  • 1
    There's another problem here. You should never be able to establish a Powershell Remoting session anonymously. Never. Something is misconfigured here.
    – Ryan Ries
    Aug 11, 2015 at 13:30
  • What's also weird is that when I type [Environment]::UserName while remoted, it displays the correct user name.
    – MgSam
    Aug 11, 2015 at 13:46
  • 1
    @MgSam Can you provide an example of the error message and the command that you are running in the remote session? If you are attempting to run a command through the remoting session that requires permissions to a network resource then the default configuration will normally prevent double hop scenarios. You should research CredSSP or RunAs accounts if you need this type of behaviour. Otherwise let us know the details so we can help you out. Aug 13, 2015 at 11:09


You must log in to answer this question.

Browse other questions tagged .