Sunday, June 24, 2012

Query and Reset the Remote Desktop session by Command on Windows Server 2012

To check and reset the current console and remote session on the Windows Server, we can use "Terminal Services Manager" (Remote Desktop Services Manager on Windows Server 2008 R2) to verify it. However, on Windows Server 2012, "Remote Desktop Services Manager" has been integrated into Server Manager. It cannot check the session. So I need to perform command, "qwinsta" and "rwinsta" to check and reset the remote session.

Prerequisites
  • Make sure the user account is a member of Remote Desktop Users or local Administrators group on servers

Using qwinsta check the session
1. On the server, log in as Domain Administrator.
2. Launch "Command Prompt".
3. To query the current session of the local server, perform "qwinsta".


There is a console session which is logged on by Administrator on this computer.

4. To query the current session of the remote server, perform "qwinsta /server:<Server Name>".


The administrator and Mark logged on the Remote Server.

Using rwinsta reset the session
5. Still on the "Command Prompt", perform "rwinsta /server:<Server Name> <Session ID>" to reset the remote session.


To reset the remote session for a non-domain server or workstation, you can use "PsExec" to connect the server or workstation and then perform "qwinsta" and "rwinsta".

Download link
PsExec

References:
QWINSTA and RWINSTA

This posting is provided “AS IS” with no warranties, and confers no rights!

No comments:

Post a Comment