November 22nd, 2012

PowerTip: Identify Disconnected PowerShell Sessions

Doctor Scripto
Scripter

Summary: Learn how to identify Windows PowerShell 3.0 disconnected sessions.

Hey, Scripting Guy! Question How can I find out which Windows PowerShell 3.0 sessions are disconnected?

Hey, Scripting Guy! Answer Use the Get-PSSession cmdlet and look for sessions that have a state of disconnected, as shown here.

PS C:\> Get-PSSession

 

 Id Name            ComputerName    State         ConfigurationName     Availability

 — —-            ————    —–         —————–     ————

  1 Session1        dc3             Opened        Microsoft.PowerShell     Available

  3 Session2        dc2             Disconnected  Microsoft.PowerShell          None

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.