Remotely kill / reset Windows sessions

If you cannot log-in via remote desktop to your Windows server because of an unresponsive desktop (for example, you get a black screen) or because there are too many active sessions, you can log-of a session remotely.

Kill a session

Step 1
Launch a Command Prompt window and Authenticate to the remote computer by using the following “net use” command:

c:> net use /user:Administrator \C$

Replace with actual NetBIOS computer name or IP address of the remote host.
For example:

c:> net use /user:Administrator \10.10.10.10C$

Now you’re connected to the server.

Step 2
Run the following command to list the active sessions on the server.

c:> qwinsta /server:

Where is the actual computer name or IP address of the remote host.

For example:

c:> qwinsta /server:10.10.10.10

A list of active and connecting Remote Desktop or Terminal Services sessions will be displayed.
Identify the connection you want to ‘kill’ and its ID.

Step 3
To reset and disconnect the Remote Desktop connections or sessions, run the following command:

c:> rwinsta  /server:

Replace with the session ID identified with “qwinsta” command, and with the actual computer name or IP address of the remote host.
For example:

c:> rwinsta 1 /server:10.10.10.10

Another option is to run following command:

c:> reset session  /server:

Replace with the session ID identified with “qwinsta” command, and with the actual computer name or IP address of the remote host.
For example:

c:> reset session 1 /server:10.10.10.10

Remote desktop

If you cannot log on to the server because all sessions are in use, you can try to log with RDP to the console session.

Start -> Run -> mstsc /console

If you still get an error, you can try to overrule a session.

Start -> Run -> mstsc /admin