Search code examples
powershell-remotingpowershell-4.0

Get list of all remote sessions?


I would like to be able to remote into a machine and then list all sessions connected to that machine that are also powershell remote sessions. I'd like to be able to grab their session id, the state of the session, etc.

Is there a good way to do that?

To clarify, I'm not asking how to remote in to the machine, I'm just asking how to detect remote powershell sessions once I'm already remotely connected.


Solution

  • Get-PSSession -ComputerName will list all the sessions on the specified computer