Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting all open PS Sessions on a remote server (from new console window)
    primarykey
    data
    text
    <p>I can start 5 new PS sessions on a remote server and see them all by running Get-PSSession</p> <pre><code>PS C:\&gt; New-PSSession -ComputerName MyServerName Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Session1 MyServerName Opened Microsoft.PowerShell Available [repeat 4 more times] </code></pre> <p>As expected, when I try to open a 6th session, I get the error saying that's a no-no (due to PoswerShells default limit of 5 concurrent remote PSSessions). But running Get-Session shows all 5 sessions so all is working as it should be so far:</p> <pre><code>PS C:\&gt; New-PSSession -ComputerName MyServerName New-PSSession : [......maximum number of 5 concurrent shells] PS C:\&gt; Get-PSSession Id Name ComputerName State ConfigurationName Availability -- ---- ------------ ----- ----------------- ------------ 1 Session1 MyServerName Opened Microsoft.PowerShell Available 2 Session2 MyServerName Opened Microsoft.PowerShell Available 3 Session3 MyServerName Opened Microsoft.PowerShell Available 4 Session4 MyServerName Opened Microsoft.PowerShell Available 5 Session5 MyServerName Opened Microsoft.PowerShell Available </code></pre> <p>However, when I close that console and open a new one, running Get-PSSession (with or without the '-ComputerName' parameter defined) shows no open sessions at all.</p> <pre><code>PS C:\&gt; Get-PSSession PS C:\&gt; </code></pre> <p>I know those sessions are still open because when I try to open a new one in my new console I get the same error regarding more than 5 concurrent sessions:</p> <pre><code>PS C:\&gt; New-PSSession -ComputerName MyServerName New-PSSession : [......maximum number of 5 concurrent shells] </code></pre> <p>According to 'Get-PSSession Get-Help -full' running 'Get-PSSession -ComputerName MyServerName should get <em>all</em> remote PS sessions on a particular server regardless of what session or computer they were started from (at least the way I understand it):</p> <blockquote> <p>"The command returns all of the sessions on [the remote server], even if they were created in different sessions or on different computers."</p> </blockquote> <p>So, is there a way to find and/or remove any open PS sessions on a remote server -- without having to do it all from one console session?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload