Monday, February 8, 2016

Log Off a Remote Desktop Session from Your Machine

"The Terminal server has exceeded the maximum number of allowed connections" is the most commonly seen message when we try RDP to the Servers. It happens is because there are already maximum allowed connections are connected through the remote desktop. Windows servers usually comes with 2 concurrent connections by default, when the 3rd user try connect to RDP they will come cross this error. It requires the installation of a the remote desktop services role and the purchase of licenses to enable additional RDP connections. 

Message:














Some times people makes a RDP connections and forgets to logoff, which blocks other users from RDPing. Instead of cursing the people who left their remote sessions open, we can find them and logoff\disconnect\close their sessions.

Two steps involved in this process:
Step 1: Find the open sessions: There are different command prompt commands to find the open RDP sessions. Open the command prompt and run one of the below commands.

QWINSTA /SERVER:Servername or IP Adress
QUSER /SERVER:Servername or IP Adress
QUERY SESSION /SERVER:Servername or IP Adress

I have used the same server for all three commands below so that we can make they are yielding the same results. I have found three open sessions. 




Step 2: Choose one and Log off\Kill\Close one session: We have different commands to do this also. First you have to choose an (session) ID from the above results. Choose one that are boxed in yellow. Below are the commands to use.

RWINSTA /SERVER:Servername or IP Adress ID /V
RESET SESSION ID/SERVER:Servername or IP Adress /V
LOGOFF ID /SERVER:Servername or IP Adress /V

For the demo I am using the above 3 commands to logoff above 3 open sessions.


Now all the sessions are logged off and free for others to do RDP.

No comments:

Post a Comment