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 Server only allows two connections through RDP, and you’ve either got two people already logged on to 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 user 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

This will connect to the physical console session on the server (also known as “session zero”). You will then be prompted with the login box and provide 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 will  have to go physically to the machine.

More info on mstsc at Technet

UPDATE:
If you have Windows Vista with SP1 or Server 2008, use the following syntax:

mstsc /admin

If you use the old switch “/console”, it will just ignore that and proceed connecting. In Windows Server 2008, the /console switch doesn’t exist anymore because “session 0″ is a non-interactive session that is reserved for services. Difference between admin and console swtich are here.

Another workaround:

You can also query the sessions on the remote machine as an administrator of that machine. Open a command prompt as a domain 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.

About these ads

64 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!

  17. Chloe said

    I agree with Andrew. How do you increase the limit over 2?

  18. Hans said

    Thanks a lot – I was out of the country and this was the only way to get back my connection.

  19. Giovanni T said

    Thank you! This tip was a great help and saved the day!

  20. Vivek said

    Great help on this topic . Thx

  21. kurokana said

    Awesome, thanks

  22. Hari Krishnan said

    Hello There,

    Even I run the command “mstsc /v:158.98.125.251 /f -console” also getting the session exceeded error message. Pls help me who to overcome this issue.

    • Sujeeth said

      Hari, If it is server 2008 or vista, make sure you use the “/admin” switch instead of “/console”. If you are still unable to connect to the console session, then my guess would be that someone was already logged in to the console session. As I wrote in my post, that if you get disconnected from this console session, you will have to go physically to the machine.

  23. Anonymous said

    Thank you Very Much

    My problem solved in just 2 minutes

  24. Anonymous said

    Hello
    My problem solved in just 2 minutes
    Great Job!!!!!!!!!
    Thank you

  25. Gary said

    Thanks. It worked a treat.
    Running XP, I opened cmd.exe as a domain admin and then used my local query.exe (not the mapped drive query.exe) to show and reset the sessions.

  26. Sohail said

    Thanks, vista update worked :).

  27. Mike said

    Thank you! I have had users from several of my clients have this happen and I can’t get in to do the work I was supposed to do. This has save me from many help(less?)desk calls in the future.

  28. Sharon said

    Hi,
    I cannt modify the limit the default this will be set to 2 connections.
    aslo see:

    http://img5.imageshack.us/img5/5228/27834827.jpg

    • Sujeeth said

      Windows Server 2003 allows 2 non-console and one console remote desktop connections. You would need to switch the server mode from Remote Administration to Terminal Server, which allows additional client connections. You need appropriate licenses from Microsoft. With XP there are few hacks around to increase this limit.

  29. pter said

    Hi Sujeeth,

    Excellent job consistent, and complete.
    You make my day…

    Thanks,

  30. ooty said

    Grate job. It helped me to login to the server. Thanks

  31. buttar said

    Thanks for sharing the helpful piece of information. I got a bit similar bit small information that can solve this problem in few very easy steps: Check the under given URL:

    http://www.itoperationz.com/2010/10/terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/

    I hop this will help someone

  32. Vera said

    This was very helpful and appreciated. Thank you.

  33. Anonymous said

    Please check this command in RUN
    MSTSC /admin

  34. Pat R said

    Thank you very much – the command line saved my life :)

  35. Mahi said

    thanks

  36. R. Ramesh said

    THanks to buttar

    Ur help is crystal clear…

  37. Anonymous said

    thanks for /admin info.

  38. dody said

    why after i execute the command for my 2003 server after login my screen goees blank (blue desktop) with no icon, anyone can help me ?

    thank you

  39. Anonymous said

    Thanks a lot, it was short and usefull

    cheers

  40. Radhakrishnan said

    I’m using 10 HCL thin clients and getting this error. So where do you want me to put this commands? ON server or on thin clients…….the thin clients doesn’t have the cmd or run options.PLease help me

  41. Manish said

    Thanks Sujeeth. Your Good work was helpful to me as well. Keep up the good work

  42. This may NOT always work, especially on Server 2003:
    mstsc /v:000.000.000.000 /f -console
    (insert your server’s IP address instead of 000)

    Then use this instead, it WORKS:

    mstsc /v:000.000.000.000 /f -admin

    When successfully logged in, click on Start, then All Programs, then Administrative Tools, launch Terminal Services Manager
    There find your server on the left, find USERS tab, right-mouse-click on each inactive user (start with highest idle time value) and select DISCONNECT.

    After that LOG OFF.

    For the future try not to simply close RDP (remote desktop client / terminal services client) window when done, but LOG OFF your server.

    Good luck!

  43. Nizam said

    hi all,

    please help…

    how to get the rdp-tcp#9(in the above picture) ip adddress? what is the command…?

  44. Anonymous said

    Excellent information

  45. Hazael Carrillo said

    Wow! excelent post!

  46. Anonymous said

    those commands work well thanks a lot!!

  47. Anonymous said

    this article isn’t work.

  48. Anton said

    Thanks for the post, it is what I am looking for.

  49. Anonymous said

    thank you! very helpful indeed

  50. Anonymous said

    Thanks great article

  51. ganeshl said

    Its really work
    Thank You very much…

  52. Hi there very cool web site!! Guy .. Excellent .. Superb .
    . I’ll bookmark your web site and take the feeds also? I’m happy to
    search out so many helpful info right here within the publish, we need work out extra techniques in this
    regard, thanks for sharing. . . . . .

  53. You will need to determine if it is the humidity and sweating that you are suffering from, as this can be relatively easy to
    fix. If you find that the area immediately around your house
    is very damp, you can add a gravel and limestone border, which will
    help with drainage. ” Equipment that is used to measure the saturation of moisture.

  54. Please note doctors don’t prescribe oral medicines for vaginal infections, it can lead to side-effects. It has a 2-megapixel rear-facing camera and a 5-megapixel front-facing one. At the impressive number one spot is the Superpad 10.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: