Query Session / Qwinsta – Windows CMD Command
Notice: A non well formed numeric value encountered in /home/future4tech/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/future4tech/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/future4tech/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/future4tech/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Notice: A non well formed numeric value encountered in /home/future4tech/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118
Notice: A non well formed numeric value encountered in /home/future4tech/public_html/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119
Display information about user sessions on a Terminal Server or a Remote Desktop Session Host (RD Session Host) server.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
Syntax QUERY SESSION [/server:ServerName] [/mode] [/flow] [/connect] [/counter] QUERY SESSION UserName [/server:ServerName] [/mode] [/flow] [/connect] [/counter] QUERY SESSION [SessionName | SessionID] [/server:ServerName] [/mode] [/flow] [/connect] [/counter] Key UserName The logon username of the user whose sessions you want to query. SessionName The name of the session that you want to query. SessionID The ID of the session that you want to query. /server:ServerName The Remote Desktop Session Host server to query. The default is the current server. /mode Display current line settings. /flow Display current flow-control settings. /connect Display current connect settings. /counter Display current counter information, including the total number of sessions created, disconnected, and reconnected. /? Display help. Qwinsta is a synonym for QUERY SESSION. |
A user can always query the session to which the user is currently logged on. To query other sessions, the user must have Query Information special access permission.
If you do not specify a session by using SessionName, UserName, or SessionID, information about all active sessions in the system will be displayed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
When QUERY SESSION returns information, a greater than (>) symbol is displayed before the current session. Sample output: C:\>query session SESSIONNAME USERNAME ID STATE TYPE DEVICE >console Administrator1 0 active wdcon rdp-tcp#1 User1 1 active wdtshare rdp-tcp 2 listen wdtshare 4 idle 5 idle SESSIONNAME The name assigned to the session. USERNAME The user name of the user connected to the session. ID The session ID STATE provides information about the current state of the session. TYPE indicates the session type. DEVICE, which is not present for the console or network-connected sessions, is the device name assigned to the session. |
Either the SessionName or the ID can be used by the Reset Session and LOGOFF commands respectfully to disconnect or logoff that session from the server.
The comment following session information is from the session profile. Any sessions in which the initial state is configured as DISABLED do not show up in the query session list until they are enabled.
The User Access permission type grants the following special permissions: Query Information, Logon, and Connect. These special permissions allow a user to Log on to a session on the terminal server. Query information about a session. Send messages to other user sessions. Connect to another session.
Permissions are set under:
Terminal Services Configuration | Connections | Properties | Permissions | Advanced | Permissions
1 2 3 4 5 6 7 8 9 |
Examples Display information about all active sessions on serverF4T: C:\> query session /server:ServerF4T Display information about active session MODEM02: C:\> query session MODEM02 |
Thanks a lot for the blog. Great.
It’s not my first time to go to see this site,
i am visiting this site dailly and take pleasant data from here
daily.