How To kill any remote desktop connections sessions with Qwinsta & Rwinsta How To kill remote connection using Qwinsta & Rwinsta on a terminal server on Windows Operating Systems

You can run the following commands to easily kill any remote sessions to a command prompt from a Windows Operating System (tested from Windows XP to Windows 10 and from Windows Server 2003 to Windows Server 2016), using Qwinsta & Rwinsta binary executable files under C:\WINDOWS\system32.

qwinsta.exe – Displays information about sessions on a terminal server and is same as the query session command.

rwinsta.exe – Resets sessions on a terminal server and is same as the reset session command.

Here the Instructions:

  1. Open windows command prompt
  2. to view current connections: qwinsta /server:myterminalserver

    This results in an output of

    console                       administrator     0         Active    wdcon
    rdp-tcp                                            65536    Listen    rdpwd
    rdp-tcp#51                 administrator     2        Active    rdpwd

  3. kill a session by: rwinsta [sessionID] /server:myterminalserver

    i.e. rwinsta 2 /server:myterminalserver
    replace “myteminalserver” with your servername or ip address.