Qwinsta (query session) command in Windows

(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012)

(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012)

The qwinsta command displays information about sessions on the Remote Desktop Session Host server (RD Session Host).

This command is equivalent to the query session.

The query session command

(Applies to Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012)

The query command displays information about sessions on the Remote Desktop Session Host server (RD Session Host).This list includes information not only about active sessions but also about other sessions running on the RD Session Host server.To learn more about how to use this command, see the example section below.

Syntax the query session

 query session [| | ] [/ server:] [/ mode] [/ flow] [/ connect] [/ counter] 

Parameter query session

Parameters

Describe

 

Specify the name of the session you want to query.

 

Specify the username of the user you want to query.

 

Specify the ID of the session you want to query.

/ server:

Specify the RD Session Host host you want to query.If you do not specify this parameter, the current rd Session Host server will be used by default.

/ mode

Show current line settings.

/ flow

Show current flow control settings.

/ connect

Displays the current connection settings.

/ counter

Displays the current counter information, including the total number of sessions created, the disconnection session, and the reconnection session.

/?

Show help at thecommand prompt.

Note the query session

A user can always query the session that user is currently logged in to.To query other sessions, users must have access to special query information.

If you use the query session without specifying parameters , or , the user query will display information about all the currently active sessions in the system.

When the query user returns information, a larger sign icon (>) will be displayed before the current session.The following is the result of returning the form of the user query:

 C:> query session SESSIONNAME USERNAME ID STATE TYPE DEVICE console Administrator1 0 active wdcon rdp-tcp # 1 active1 1 active wdtshare rdp-tcp 2 wdtshare listen 4 idle 5 idle 

Larger icon ( > ) indicates the current session. SESSIONNAME specifies the name assigned to the session. USERNAME indicates the username of the user connected to the session. STATE provides information about the current state of the session. TYPE said what kind of session this is. DEVICE (parameter not in the control panel or network connected session) is the device name assigned to the session.Comment Line following session information is from the session profile.Any session in which the initial state when configured as DISABLED will not be displayed in the query session list until they are enabled (ENABLED).

For example, the user query

To display information about all active sessions on the server with SERver2, enter:

 query session / server: SERver2 

To display information about the active session named modeM02, type:

 query session modeM02 

See more:

  1. The qprocess command in Windows
  2. Qappsrv (query termserver) command in Windows
  3. The quser (query user) command in Windows
  4. The pubprn command and the pushprinterconnections command in Windows
Update 26 May 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile