RDP: Query users on a remote desktop server using command prompt
If you need to find out which users are logged into a remote server either at the console or over RDP you quickly can type in a command to do this instead of using Remote Desktop Services. You need to be logged in as an administrator on the domain or an account that has access to the remote computer.
- Open up a Command Prompt.
- Type in the following:
query user /server:servername
- Example with a server named TerminalServer1
C:\>query user /server:TerminalServer1
- You should see an output that looks something like this:
C:\>query user /server:TerminalServer1
- Output
USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME
lhking console 1 Active none 3/4/2016 9:06 AM