Reconnecting to a loopback PSSession from another computer

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Max Kozlov Max Kozlov 11 months, 2 weeks ago.

  • Author
  • #31858
    Profile photo of Jeff

    On the server , open powershell and type

    New-PSSession -ComputerName localhost

    A new PSSession is created in the local computer, Get-PSSession returns the session information correctly.

    Now go to another computer (client), and open Powershell and type

    Get-PSSession -ComputerName  -UseSSL -Port 5986 -Credential (Get-Credential) -SessionOption (New-PSSessionOption -SkipRevocationCheck)

    **Nothing is returned (returns $null)**

    I'm 100% positive WinRM is set up properly and the firewall is not blocking access. To verify this:

    On the client computer, type

    New-PSSession -ComputerName  -UseSSL -Port 5986 -Credential (Get-Credential) -SessionOption (New-PSSessionOption -SkipRevocationCheck)

    and I can see that the session is created successfully on the server.

    And now go to another client computer (client2), and type

    Get-PSSession -ComputerName  -UseSSL -Port 5986 -Credential (Get-Credential) -SessionOption (New-PSSessionOption -SkipRevocationCheck)

    and I see that the session info is returned correctly.

    To summarize:

    – A PSSession launched into the server, from the server (loopback) is
    not visible to client computers, only visible to the server.
    – A PSSession launched into the server, from the client is not visible to
    the server, but it is visible to all client computers.


  • #31878
    Profile photo of Max Kozlov
    Max Kozlov

    did you try to Get-PSSession -Computername server on server itself ?
    may be localhost not equal "server" in term of session binding ?

    I try to create new-session -comp server on client and get-pssession on server => nothing
    but when I try get-psssession -comp server on the server, then I see It

You must be logged in to reply to this topic.