Scribblings of a TechnoBuff

Exchange IIS ASP.NET OCS Sharepoint Windows

The terminal server has exceeded the maximum number of allowed connections

Posted by Sujeeth on July 9, 2008

When a user tries to connect to a machine using Remote Desktop connection, they might come across this error message.

The terminal server has exceeded the maximum number of allowed connections

This is because Windows only allows two connections in RDP, and you’ve either got two people already logged on that machine, or you’ve got disconnected sessions that still thinks they are active. If a user simply closes the remote desktop window when they’re finished, that username will still remain logged on, unless there is a time out configured in Terminal Services Configuration as follows

Terminal Services Configuration

Terminal Services Configuration

If the Session time out is not configured, or the logged on users are not available, you wont be able to logon to the machine. To overcome this limitation, follow the steps as below.

open a command prompt or type in the RUN prompt

mstsc /v:[00.00.00.00/SERVERNAME] /f -console

eg: mstsc /v:192.168.1.10 /f -console
      mstsc /v:ADSURF /f -console

You will then be prompted with the login box and proivde the administrator details. Then you will be connected to the Console Session on the server. Now you can reset the disconnected user sessions from Terminal Services Manager. Please note that if you get disconnected from this console session, you have go physically to the machine.

More info on mstsc at Technet

UPDATE: 
If you have Windows Vista with SP1, use the following syntax:
Another workaround:

You can also query the sessions on the remote machine as an administrator of that machine. Open a command prompt as a domian administrator that the remote machine is set to or map a drive of that remote machine.

Then in the command prompt, type as below:

query session /server:servername

Replace servername with the remote machine name or IP address.

Now we have the information of all the users/sessions that are active/disconnected on the remote machine. We can now reset one of the session with the following command.

reset session [ID] /server:servername

Replace [ID] with the number from the prevoius output and servername with the remote machine name or IP address. This will reset the session and now you can login using Remote Desktop connection.

mstsc /admin

If you use the old switch “/console”, it will just ignore that and proceed connecting.

16 Responses to “The terminal server has exceeded the maximum number of allowed connections”

  1. K.N.V.H.SURESH said

    thank you very much this article is usable to me

    my problem is solved to use this article/ command

  2. I agreed with you

  3. Jason said

    When I enter “query session /server:XxXxXxXxXxX” in the cmd line on my XP Pro workstation…I receive the following error:

    ‘query’ is not recognized as an internal or external command,
    operable program or batch file.

    Any ideas?

    TIA

  4. Sujeeth said

    Jason,

    Try looking in folder “\WINDOWS\system32\dllcache” and copy the query executable file to %systemroot%/system32. It should work. Alternatively you can try installing Windows Support Tools(http://technet.microsoft.com/en-us/library/cc755948.aspx)

  5. Jon said

    I have written a GUI that does this for you if anyone is interested. It allows you to query a server by name or IP and kill a specified user. It can be found at: http://www.jonathanrhodes.net/

  6. devil said

    mstsc /v:192.168.1.10 /f -console

  7. Matt said

    Great suggestions. Just helped me out to remote login to our office’s print server when two of our people were taking up the only connections and were both out of the office.

  8. Snow White said

    Access your computer from any PC, Mac, iPhone or other mobile device with PCNow http://webex.we.bs/

  9. N. Blake said

    Great. This sure saved me some time. We have several administrators who always forget to log off. I wont show them this command

  10. Andrew Tagg said

    Errr, so whats the point of a terminal server if only 2 people can connect to it?

  11. Dinesh said

    Thanks…Sujeeth ….

  12. Swami said

    This article was very very helpful. it saved 30 minutes ($$$$$$$$$$$).

  13. Furkan said

    Thx For Info

    Furkan

  14. Gilberto said

    Thanks it did work for me, thanks

  15. Anonymous said

    It really help me.

    thank u very much………

    Irfan

  16. Anonymous said

    Thanks it was a huge help!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>