Skip to content

All About QWINSTA Windows command

The Windows qwinsta command is a powerful tool for managing remote desktop sessions. With qwinsta, users can view information about active remote desktop sessions, such as session ID, username, state, and session type. This command is especially useful for system administrators who need to manage multiple remote desktop sessions on a Windows server. By using qwinsta, administrators can easily identify and disconnect idle or disconnected sessions, troubleshoot session-related issues, and improve overall system performance.

Terminal window
qwinsta [Optional parameters]
OptionDescription
/?Displays help for qwinsta
ParameterDescription
SESSIONNAMEFilters the results to the specified session name
/SERVER:ServerNameSpecifies the remote server to connect to
Terminal window
qwinsta

Display a list of all active Remote Desktop sessions on the system.

Get Detailed Information of Specific Session ID

Section titled “Get Detailed Information of Specific Session ID”
Terminal window
qwinsta 2

Retrieve detailed information for the specific session ID “2”.

Terminal window
logoff 3

Log off the Remote Desktop session with the session ID “3”.

Terminal window
qwinsta /?

View the help and usage information for the QWINSTA command.

Terminal window
qwinsta /server:computername /filter:user=username

Filter the output to display Remote Desktop sessions belonging to a specific username on the specified server.

Terminal window
qwinsta /server:computername /mode:table

Display session information in a tabular format for easier readability.

To use the qwinsta command in Windows, execute the following command:

Terminal window
qwinsta

The qwinsta command in Windows is used to display information about Remote Desktop Services sessions.

How can I list all Remote Desktop Sessions using qwinsta?

Section titled “How can I list all Remote Desktop Sessions using qwinsta?”

To list all Remote Desktop Sessions using qwinsta, you can run the command:

Terminal window
qwinsta /server:servername

How to filter the results of qwinsta based on a specific RDS session state?

Section titled “How to filter the results of qwinsta based on a specific RDS session state?”

You can filter the results of qwinsta based on a specific RDS session state by using the following command:

Terminal window
qwinsta | find "Disc"

How to log off a user session with qwinsta?

Section titled “How to log off a user session with qwinsta?”

To log off a user session using qwinsta, you can run the command:

Terminal window
rwinsta <sessionid>

How to retrieve detailed information about a specific session with qwinsta?

Section titled “How to retrieve detailed information about a specific session with qwinsta?”

To retrieve detailed information about a specific session using qwinsta, execute the command:

Terminal window
qwinsta <sessionid>

Can qwinsta be used to query Remote Desktop Session Host servers?

Section titled “Can qwinsta be used to query Remote Desktop Session Host servers?”

Yes, qwinsta can be used to query Remote Desktop Session Host servers by specifying the server name in the command:

Terminal window
qwinsta /server:RDSServerName

How to display the session ID along with the session names using qwinsta?

Section titled “How to display the session ID along with the session names using qwinsta?”

To display the session ID along with the session names using qwinsta, run the command:

Terminal window
qwinsta /v
  • Check the active sessions on a Windows server
  • Display information about Terminal Services sessions
  • Disconnect or log off a user session from the command line