I have a wide scope of interests in IT, which includes hyper-v private cloud, remote desktop services, server clustering, PKI, network security, routing & switching, enterprise network management, MPLS VPN on enterprise network etc. Started this blog for my quick reference and to share technical knowledge with our team members.
Thursday, August 4, 2011
Display currently logon terminal services users
To display the currently logon users on a terminal server or session host on Windows Server 2008, use this command:
query session /counter [ /server:servername]
For example, to count the number of active users:
query session /counter | find /c " Active "
find filters the output that contains "Active" and count them with the "/c" option.