Killing Hanged Terminal Service Session in Windows Remotely

If you use Windows Terminal Services for remote desktop access, it’s common to run into this nasty error message from time to time:

The terminal server has exceeded the maximum number of allowed connections.

Step1 : Finding disconnected sessions with qwinsta or query

Open Cmd prompt and type :  qwinsta /server:10.245.220.46       Please replace this 10.245.220.46 with your server IP address

Capture

 

Now note down the session id of Disconnected session. In our case it is 1.

 

Step 2: Killing disconnected sessions with rwinsta or reset

In CMD prompt type this command :   rwinsta 2 /server:10.245.220.46

Capture

Now you can see that the session is killed by running the qwinsta /server:10.245.220.46   again.

Good Luck

 .