Saturday, June 25, 2011

The Terminal Server has exceeded the maximum number of allowed connections

Problem

If  users simply close the remote desktop window; their sessions remain disconnected and if TS Session is not configured to end the disconnected session after a certain time limit, further user login to that terminal serer won't be possible due to the following error:









Resolution
  1. Open Command Prompt and execute the following command:

    query session server:<server name>(OR)
    query session server:<IP address>

    Replace the <server name> or <IP address> with the remote machine host name or IP address.

    For example, query session server:TS-1[Note: Here TS-1 is the Terminal Server host name I am using.]


     
  2. This will show the details of the connected or disconnected users. Note down the ID and corresponding username you want to reset.

  3. To reset a particular ID execute the following command:

    reset session <ID> /server:<server name>

    For example, reset session 2 /server:TS-1
     
    [Note:
    You can also use a nice GUI tool to query and reset the remote sessions. Please click HERE to download the tool named Remote TS Manager from JR Software]



    Here I have resetted all the users sessions existing on the TS-1 server.
     
  4. To check the session status execute the command mentioned in Step:1.

    query session server:<server name>(OR)
    query session server:<IP address>


     
  5. Now if you try to RDP to that server, you will be able to do that.
     
  6. Once you logged in to the server, go to Start --> Programs --> Administrative Tools --> Terminal Services Configuration.
     
  7. Right click on RDP-Tcp --> Propreties.


     
  8. Enable Override User Settings check box and enter the time in End a disconnected session. This will prevent to occur this type of problem going forward.

Alternative method to reset user session (GUI Based)
  1. Login to any other server.
     
  2. Go to Start --> Administrative Tools --> Terminal Services Manager

     
  3. Click on Actions --> Connect to Computer...--> enter the server name where you want to connect --> click OK
     
  4. Now you will get all sessions of that server. Right click on the desired user and choose Log Off.

No comments:

Post a Comment