Displays information about user sessions on a terminal server.
query user [{UserName|SessionName|SessionID}] [/server:ServerName]
UserName : Specifies the logon name of the user you want to query.
SessionName : Specifies the name of the session you want to query.
SessionID : Specifies the ID of the session you want to query.
/server:ServerName : Specifies the terminal server you want to query. Otherwise, the current terminal server is used.
/? : Displays help at the command prompt.
| • | You can use this command to find out if a specific user is logged on to a specific terminal server. Query user returns the following information:
| ||||||||||||
| • | To use query user, you must have Full Control permission or Query Information special access permission. | ||||||||||||
| • | If you use query user without specifying a user name, session name, or session ID, a list of all users who are logged on to the server is returned. Alternatively, you can also use query session to display a list of all sessions on a server. | ||||||||||||
| • | When query user returns information, a less than (>) symbol is displayed before the current session. | ||||||||||||
| • | The /server parameter is required only if you use query user from a remote server. |
To display information about all users logged on the system, type:
query user
To display information about the user USER1 on server SERVER1, type:
query user USER1 /server:SERVER1
| Format | Meaning |
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font | Code or program output |