Thanks to Joe Klemencic, TSListUsers is a great little console tool that shows you the currently logged on users and which session they use:
List Terminal Services Users
TSListUsers is a command line utility to list both the currently connected and disconnected users, hostname, IP address and RDP session number on either the local or a remote Windows Terminal Server/RDP Server
To list the users, you need to have the following abilities:
- NetBios access to the server
- Permissions allowing you to Query RDP session information (if you can log into the TS, you should have this by default)
- Terminal Services/RDP should be running on the target host
Usage:
TSListUsers.exe /? to get the Help text
TSListUsers.exe to query a target Terminal Server
TSListUsers.exe with no paramters to query the local hostYou can download TSListUsers from here.
Example output of remote session:
C:\Windows>TSListUsers.exe Active Connections: Username, HostName(IP), SessID, RDP-Port ---------------------------------------- jeroenp, W701UJPL (192.168.71.34), 2, RDP-Tcp#92 Disconnected Connections: Username, HostName, SessID --------------------------
Example output of local session:
C:\Windows>TSListUsers.exe Active Connections: Username, HostName(IP), SessID, RDP-Port ---------------------------------------- jeroenp, 1, Console Disconnected Connections: Username, HostName, SessID --------------------------
–jeroen