Sunday, November 18, 2012

How to kill a windows session – unable to logon windows……

How to kill a windows session – unable to logon windows……

We often face “Sessions has reached maximum limit” while connecting to a windows server to troubleshoot SQLServer/other applications, actually when you RDP to a window box, it will create a session with ID and windows allows only 2 remote connections, the next connection whoever tries to connect will get rejected. So as soon as we are done with our work on any windows box you have to log off the box otherwise that session will remain for some time based on the Administrator time setup.

So what do we do in case of sessions are already reached maximum limit.


First you have to list what are the connections are connected to server. Below command will list you that information.

Syntax: Qwinsta /server:<Servername>

Qwinsta /server:ABWZP4154

It displays two connection connected to ABWZP4154.
Connections are two types- Active and Disconnected
If you see disconnected connection, note down the session –ID and kill it by executing below command, after killing you are able to RDP to the server.
Syntax:
Rwinsta /server:<servername> <Session ID>
Rwinsta /server: ABWZP4154 2
Incase if you see both the connection are active then  you have to choose which to kill. It is up to you J

No comments:

Post a Comment