New-PSSession localhost access is denied

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Nick Nick 6 days, 23 hours ago.

  • Author
    Posts
  • #70907
    Profile photo of Nick
    Nick
    Participant

    Hi everyone,

    I'm trying to create a new PS Session to localhost just to try it. However I have a problem already at this step.

    Yep, I'm obviously using admin account. Any idea what it could be?

    PS C:\WINDOWS\system32> New-PSSession -ComputerName localhost

    New-PSSession : [localhost] Connecting to remote server localhost failed with the following error message : Access is denied. For more information, see the
    about_Remote_Troubleshooting Help topic.
    At line:1 char:1
    + New-PSSession -ComputerName localhost
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed

    Apparently, this problem appears on machines running Windows 10.

  • #70909
    Profile photo of Chris
    Chris
    Participant

    It could be to do with credentials, try using Get-Credential, sign in and see if it gives you an error?

    $C = Get-Credential
    
    New-PSSession -ComputerName localhost -Credential $C
  • #70937
    Profile photo of Nick
    Nick
    Participant

    Chris, thanks for your answer. I'm sorry I forgot to mention, credentials don't change anything. The same script works fine on Windows 7, but not 10.

You must be logged in to reply to this topic.