Phil for Humanity Phil for Humanity
A Guide for the Survival of Humankind and Helping the World, Society, and Yourself.



Windows Support: Finding Remote Logged On Users


Have you ever tried to log into a remote computer running Windows, but you were not able to because too many people were already logged in? When this happens, the typical error is usually this:

 The terminal server has exceeded the maximum number of allowed connections.


Here is a simple Windows command to determine who is already logged into another computer. I believe the other computer must be running Windows too, but I am not 100% sure. With this information, you now know which person(s) to ask if they can logoff so that you can login.


 query user /server:MACHINE_NAME
 
Here is a short quick example of this command in action with its output:

 C:\>query user /server:MACHINE_NAME
  USERNAME              SESSIONNAME        ID  STATE   IDLE TIME  LOGON TIME
  USERNAME1              rdp-tcp#45         1  Active  7:05 4/28/2009 10:49 PM
  USERNAME2              rdp-tcp#47         2  Active  57   4/29/2009 11:22 AM
 
Alternatively, you can also see all the sessions running on the machine to determine who is running what.

 query session /server:MACHINE_NAME
 
Here is an example of this command in action with its output:

 C:\>query session /server:MACHINE_NAME
  SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
  console                                     0  Conn    wdcon
  rdp-tcp                                 65536  Listen  rdpwd
  rdp-tcp#45        USERNAME1                 1  Active  rdpwd
  rdp-tcp#47        USERNAME2                 2  Active  rdpwd
 
Good luck logging in!

by Phil for Humanity
on 20090429

Related Articles
 » Windows Support: Finding Hostname from an IP Address
 » Will Artificial Intelligences be Evil?
 » The Problems with IT Firefighting