137

ERROR The terminal server has exceeded the maximum number of allowed connections

Terminal Server Error Message

When a user establishes a Remote Desktop connection to the WHS this connection will remain active until the user selects “Log Off” from the Start Menu. If a user simply closes the remote desktop window when they’re finished, that username will still remain logged on.

The software running on the WHS to facilitate the Remote Desktop connection will only allow for up to two simultaneous sessions. Active and disconnected sessions are calculated in this connection limit as is the Administrator account also. The console session, however, does not count against the connection limit.

If a third attempt is made to login to the server, the dreaded “The terminal server has exceeded the maximum number of allowed connections” error will be shown to the user, and they will be unable to complete the login process. You can’t even connect to disconnect the old sessions BUT there is a way around this:

Simply click OK to the error message and wait for unto 30 seconds for the window to close then simply type the following in a Start – RUN or CMD Prompt on your client machine.

mstsc /v:00.00.00.00 /f -console
 
Replace 00.00.00.00 with your server’s IP Address or server name. e.g.SERVER

Type in your administrator password. This will then connect you to the Console Session on the server and allow you to remote control the machine again.

Once in Click Start, point to All Programs, point to Administrative Tools, and then  click Terminal Services Manager.

In the left hand column you should see your server name. Click on it once. Note the Users Tab in the right pane.

You should see a list of users. You need to reset the two “Disconnected” users. You can do this by right clicking the disconnected user and selecting “Reset.” You should now be able to connect with RDP again after Start – Log Off.

When logging in under this special Console session always kill the inactive sessions first, because if you get disconnected again you will have to connect your monitor, keyboard and mouse.

Only use this session to terminate the other two sessions and not for any other use.

In future when you are done with a Remote Desktop session on WHS, you should always use “Log Off” rather than disconnecting by closing the RD window with the X as this will disconnect from the session but leave it active.

P.S. You could also use the easy option and just reboot the Windows Home Server.

Share this WHS Article with Others:

| |

About the Author

Comments (137)

Trackback URL | Comments RSS Feed

  1. markvader says:

    Is it possible to increase the number of allowed connections to a higher number, e.g. 5 to decrease the liklihood that you would have to perform this reset proceedure?

  2. Hi markvader,
    Unfortunately it is not possible to increase the number of allowed connections to a higher number. I am afraid with are stuck with 2 only.

  3. Mikko Oesch says:

    Brilliant! It works!

  4. Hi Mike Oesch,
    Glad I could be of service.

  5. Waqas Murtaza Butt says:

    Thanks a lot. You saved my life.

  6. Hi Waqas Murtaza Butt,
    I’m glad I could help you.

  7. Jeff says:

    Hi Philip,

    Nice work. Got a related query if you can help. If a user receives the “exceeded the maximum number of allowed connections” message, does it get logged to any event log?

    It’s not really a login failure, so I can’t seem to find it in security logs. Am I looking in the wrong place?

  8. Hi Jeff,
    The only places I could find on the server that has logged info is in Event Viewer, Security items and in Terminal Services Manager, This Computer branch, “your server name”, and on the right hand side the Sessions tab.

  9. ian nix says:

    This info is very helpful! Especially in a multi windows server environment like our office and the sys administrator is always missing in action hahahaha, Thanks a lot!

  10. Hi ian nix,
    Glad we could be of service. Sys administrator, who are they lol.

  11. bharathy says:

    Thanks for the great info it works fine

    thanks a lot one more time thanks MR.Philip Churchill

  12. Hi bharathy,
    Glad we could help.

  13. Ed says:

    you are the man, this saved me

  14. Hi Ed,
    Glad we could help.

  15. PSLIM says:

    really just want to say big thank you. you save my time of traveling to office from home just to physically logging the server to kill those inactive user before I can logging from home again. Thanks again.

  16. Mike Nichols says:

    Add me to the list…
    ditto ditto ditto
    Thank You for posting this for all of us…

  17. Deb Singh says:

    Bingo.. this is exactly what I needed.. Very well written.. thanks Philip..

  18. Bernard says:

    Thanks man.
    Help me to resolve the 2 connection limits and find out who is hogging the connection~!

  19. Mahnaz Siddiqui says:

    Thanks a ton! This was awesome.

  20. Xataraxx says:

    Nice! And as an added bonus, I got to make it look like I knew something the boss didn’t. 🙂

  21. RDP user says:

    Thanks Philip. Big help!

  22. Leonard says:

    This is some useful info, as the users have a habit of simply closing the connection as opposed to logging off.
    Wish the number could be increased though.
    Thx alot.

  23. Max says:

    Good tip! Before I knew this I used the free service of http://www.logmein.com to log in as administrator to log off the inactive users.

  24. Haider says:

    Please Philip Churchill
    maybe there is a way to increase the connections more than 2?
    because there is a teb (unlimited connections)
    can you help me
    Haider

  25. MicrosoftJunkie says:

    The way remote desktop for administration works in terminal services is that you are allowed: 1 console session for admin purposes and 2 rd sessions for users. The only way to increase this number is to install terminal server and add some cals to the server. Once you install terminal server and switch to remote desktop for apps instead of administration, you will be given a grace period, something like 90 or 180 days, before having to setup the licensing. Hoever, this is only meant for giving you time to set this up, it isn’t intended soley as a free grace period.

  26. jayant says:

    Hi Philip,
    i did, as you have explained, but still got the same error message of – the terminal server has exceeded the maximum number of allowed connections. any solution for the same. Thanks.

  27. jonnymac says:

    This doesn’t seem to work on a Windows 2000 server. Any ideas (other then upgrading of course).

  28. init says:

    THANKS. I choose the easy way: reboot my server. because i use WIN2K.

  29. lasha says:

    thanks
    it was very understanding and helpfull article

  30. Praveen says:

    Thanks Philip for sharing your knowledge and helping others.

  31. Parb says:

    dont know where is a difference, but in my client I need to type /admin comand instead of -console… so, the full url are :

    mstsc /v:00.00.00.00 /f /admin

    btw, You can always check available keys using
    mstsc /?

  32. Aryan says:

    YOU ARE MY HERO

  33. Jon says:

    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/

  34. Simon says:

    Aaah! Almost… This is the closest I get…
    I get a user login box, but whatever I type I still get ‘Exceeded maximum number of connections’

    The server is in another country so switching it off is not really an option, its also behind a firewall where only port 80 & 3389 are open.

    Any ideas?

  35. Steven says:

    Thanks! It was a very helpful article! 🙂

  36. mike says:

    THANK YOU!!! You just saved me 20 minutes drive time. More importantly, I now know how to fix the issue the next time I forget to logout (cause you know it’s gonna happen).

  37. john paul says:

    i want to renew this server ks200724.kimsufi.com
    but i don’t know how to renew it,can any one pls explain to me the process i could renew this server ks200724.kimsufi.com

  38. David says:

    Arrgh, I wish I had this information the last time it happened! Could not figure out what to do for the life of me; had to reformat in order to connect again. Thanks for the info though. Now I know exactly what to do if this happens again.

  39. mauro says:

    VERY useful info!
    Thanks a lot.
    🙂

  40. Michael says:

    Is there a way to automatically log of a user/session after X amount of inactivity?

  41. Stephane says:

    GREAT TIP! Thanks a lot!

  42. nikos says:

    Michael go to the user properties and under the “sessions” tab you’ll find what you want!!! 🙂

  43. Richard says:

    I have read this entire thing, and unless I TOTALLY missed it . . did anyone mention install the admin pack (any server \\homeserver\admin$\system32\adminpak.msi ) and use tsadmin.exe? I saw where someone wrote an app, but I think Micro$ofts “supported” app would be a better way to go . .unless again . . .I missed something. with this you can disconnect sessions until your heart stops. – R

  44. santosh says:

    terminal server has exceeded the maximum number of allowed connections

  45. Richard says:

    Is that an answer to my post? If so . . . . huh?

  46. Khaing, Pyay says:

    Big Help!and Thanks alot
    But ,I want to know why we cann’t increase the number of allowed connections.

  47. Joao Marto says:

    Khaing: Quonting MicrosoftJunkie:”The way remote desktop for administration works in terminal services is that you are allowed: 1 console session for admin purposes and 2 rd sessions for users. The only way to increase this number is to install terminal server and add some cals to the server. Once you install terminal server and switch to remote desktop for apps instead of administration, you will be given a grace period, something like 90 or 180 days, before having to setup the licensing. Hoever, this is only meant for giving you time to set this up, it isn’t intended soley as a free grace period.”

  48. Rafael says:

    How can I check what users are using the 2 sessions?

    Thanks in advance

  49. David says:

    Rafael, you should be able to see what users are using the two sessions by following the instructions above.

    See the original notes, “… In the left hand column you should see your server name. Click on it once. Note the Users Tab in the right pane. You should see a list of users.”

  50. Romy says:

    This is a nice solution but I want to know, How can I increase the limit of users on terminal server (O.S. 2000 server) ?

    Please help me.

    Thanx & Regards
    Romy.

  51. Renata says:

    Hello, it’s a nice temporary solution.
    So, I changed the parameter:
    “maximun connections” on the network adaptor icon from Terminal Services Configuration, I verify the registry (MaxInstanceCount) and the value was changed.
    But I think that the limit is always 2.
    Have you got an idea about?
    Best regards.

  52. Stamen says:

    Thanks a lot!

  53. Hach75 says:

    Thanks a lot for sharing this. You saved me

  54. Thank you very much. It does saved lots of my time…

    You saved me… Cheers

  55. Thanks for sharing…

  56. venugopal says:

    thanks for the information.

  57. james says:

    saved my life bud, thanks!!!

    did have to use this: mstsc /v:00.00.00.00 /f /admin

  58. Jasvinder Singh says:

    If the above solution did not work as it not worked for me i extended the command admin switch
    and login with Admin userid and password

    mstsc /v:xxx.xx.xxx.xxx /admin

    Replace xxx.xx.xxx.xxx with your IP Address

    Happy logging

  59. Rajesh says:

    You are the man….thanks a lot buddy..You saved me…

  60. Chris Brecken says:

    A quick way to check logons is to go into task manager, select the last tab (Users) and you can see who is logged on and/or disconnected.
    You also get the option to log them off and hence reclain the termin server session
    I just find it much quicker to check this
    Cheers

  61. Asad says:

    It works! just works. Thanks

  62. Hubby says:

    You have nol idea how much of a headche you just saved me from. mstsc /v:00.00.00.00 /f /admin is what I had to use. Thanks a million…IT folks will ALWAYS SAVE THE WORLD. Peace!!!!!!!!!!!!!!!!!!!!!!!

  63. maria says:

    Thanks!

  64. alex_gost says:

    THIS IS THE LIFE SAVER RIGHT HERE
    log off remote desktop RDP Terminal exceeded

    run:
    mstsc /v:00.00.00.00 /f /admin
    replace 00 with your server IP

    thank you all, thank you james!

  65. Jose says:

    I use the admin switch and it works great! i am using XP. and our users always leave the connection on in the windows 2003 server! thank you very much for the tip!!!

  66. Antony says:

    Thanx alot mate.Saved My life

  67. hem says:

    ohh….thank you so much…saved my day!!

  68. Han says:

    Oke it works fine.
    Tnx.

  69. NeerjuGupta says:

    Very Nice. Thank You.Saved my day 🙂

  70. ovi says:

    you write:
    Khaing: Quonting MicrosoftJunkie:”The way remote desktop for administration works in terminal services is that you are allowed: 1 console session for admin purposes and 2 rd sessions for users. The only way to increase this number is to install terminal server and add some cals to the server. Once you install terminal server and switch to remote desktop for apps instead of administration, you will be given a grace period, something like 90 or 180 days, before having to setup the licensing. Hoever, this is only meant for giving you time to set this up, it isn’t intended soley as a free grace period.”
    But where to get this or buy these cals for WHS?
    need 3 more thx

  71. sandeep gautham says:

    for 2k use the following:
    qwinsta /server:0.0.0.0
    rwinsta /server:0.0.0.0 session_num

    replace 0.0.0.0 with ip of server
    session _num = session_num as displayed in the output of qwinsta.

  72. Badarinatha says:

    Thanks a lot. You saved my time

  73. ivy says:

    Thank You, You saved the day

  74. VinyX says:

    This brilliant I was about to reboot the server you have just made my work more easier than before.

  75. Elvis says:

    Thank You, very much

  76. piyush says:

    This was great!!! This worked if my client was win2k. for xp mstsc /v:servername /admin worked.
    thanks Jasvinder

  77. Mark says:

    Hi – wondered if anyone could help me out.

    I need to find out how many concurrent client connections Windows Server 2008 can handle as we are currently bringing our hosting in house and thinking of buying a box with windows server 2008 R2 on it.

    I understand that this all depends on your set-up but we currently have about 50000 unique visits a day and I need to find out how many unique visitors we could have if we brought our hosting in house.

    I have been looking for an answer for about a week now and keep drawing up blanks so any help would be really appreciated.

    Thanks,

    Mark

  78. Maja Palra says:

    Many blessings for the /admin entry — that worked for me.

    Another thing you can do is bring up a command window
    and run:

    qwinsta /server:<server name or IP>

    This will list whose connected. After finding one that can
    be removed, get the entry from the ID column and run:

    rwinsta /server:<server name or IP> <ID>

  79. Daniel Paez says:

    It worked this way for me:

    mstsc /v:[SERVERIP] /f -console

  80. Jerry G says:

    I’m using XP for the client and the remote box is running WIN2000. It’s not working 🙁 It connects but when I input the log in credentials, it gives me the same error.

  81. Hari Krishnan says:

    Hi,

    I got the error message “The terminal server has exceeded the maximum number of allowed connections” while trying to open remote desktop from my desktop (win xp sp3). So i have execute the command “mstsc /v:00.00.00.00 /f -console”. Even though i am getting the same error message. Please suggest me how to fix this problem.

  82. Jason says:

    It does not work for me…
    It will open the RD window however if you already have 2 logged in RD clients you will receive the same error…
    Has anyone that is claiming it works actually tried to use this console command code while having 2 users already logged in via RD.. If so it will not work, Maximum 2 exceeded error will still pop up even as Console login…?

    mstsc -v:0.0.0.0 -admin This will work to get a 3 login working on Windows Server 2003… the /console login has never worked for me personally…

  83. Tony says:

    It does not work for me either…
    Then I do qwinsta /server: it gives me an error “Error [1722]: The RPC server is unavailable”.

    I’m trying to shutdown sessions on a Windows 2000 Server.

    Any help would be appreciated as the server is in the UK and I am in Australia!

  84. Nathan says:

    Tony;

    If you have another server, probably on the same domain (mebbe?) you can use the following app;

    start -> run -> %SystemRoot%\system32\tsadmin.exe

    I’ve found that to be easier than the command line.

    Otherwise, you will have to auth to the server first (a net use command works, amongst other things) to be sure your admin account authenticates before you can list/disconnect the remote sessions.

    If you need a hand, shoot me an email (nathan.murphy at framegroup.com.au) and I’ll see if I can help. Always willing to assist another Aussie.

  85. Mohamed Mokhtar says:

    Perfect…Perfect…Perfect 🙂
    I was stuck at my work as I cant have access on the server itself except remotely.

    Thanks so much for your support
    Best Regards,
    M.Mokhtar

  86. jjfierogt says:

    Umm, I think you all are just making this WAY more difficult then it needs to be. Why not just run the WHS Console, click options, then click “Reset the Windows Home Server Console…”???? This works everytime for me and I always just close RDP using the “x”. Sometimes Microcrap builds in solutions, you don’t always have to make it so complicated.

  87. Chipster says:

    In my case I’m running Windows 7 and am having a problem even getting into the WHS Console because of network problems, so I can’t use it to reset the Remote Desktop Connection. I’ve tried several of the suggestions but still get the same message. Anything special needed for Windows 7?

  88. jjfierogt says:

    Are you able to log in at the home server itself or are you running totally headless? If you can log in at the server, run windows update. There has been a lot of work done to make win7 work great with WHS. You will need to copy the “new” connector software from the software folder and install it on the client. If you are having network issues not related to the server then this probably wont work as the connector software needs to “see” the WHS to install. Let me know if I can be of anymore help.

  89. Georgi says:

    The admin console procedure works (Windows Server 2003 R2), thanks a lot! 🙂

    However in order to use the qwinsta and rwinsta commands you need to have network access to the RPC port of the server. It is unfortunately very often blocked by firewalls in order to avoid hacker attacks. So do not count on these two commands in every occasion.

  90. David Sonar says:

    No, it does not work

  91. Sergio says:

    sometimes it happens

  92. mixsms says:

    very very useful information i got here, i had host my site on VPS and almost getting the issue which is described here, and due to which my site got down and i can’t do anything but with this i can again access my VPS .. Thanks a lot

  93. vijaypal says:

    hi
    i use in server 2003 but problem my rdp user login
    my server 55 user login no problem but login 56,57 user not loding user profile error

  94. Singlestone says:

    Entered:
    mstsc /v:[remote.ip.address] /f -console

    Got:
    Sign-in for Remote Desktop

    Entered:
    Credentials

    Got:
    “The terminal server has exceeded the number of allowed connections.” Again.

    These instructions:
    Fail.

  95. Nagarajan T says:

    Thanks for your valuable information. it’s working fine.

  96. Shahid Khan says:

    Works like a charm in 2k3 with
    mstsc /v:[remote.ip.address] /f -admin

    Thanks for sharing

    • uju says:

      -console didnt work for me. was almost frustrated till i tried -admin and it, like you said worked like a charm. thanks very much for sharing.

  97. Jas says:

    Nice Tip , works for me …
    Thanks

  98. Nghia says:

    Thanks you very much !

  99. buttar says:

    I found another solution to work around this problem. you just need to to query the sessions and then reset any session you want and you can easily login: check the under given URL:
    http://www.itoperationz.com/2010/10/terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/

  100. Prashanth A says:

    Thanks .. a Ton..
    Useful Piece of Information

  101. niranjan says:

    Thanks , I worked . other wise I would have landed in trouble .

  102. Junior Dias says:

    Works Great!

    mstsc /v:myserver.no-ip.org /f -admin

    Windows Server 2003 Standard

    Thanks!

  103. Saravanan says:

    Cool..

    Worked like charm…

    Thank you. 🙂

  104. Leo says:

    Struggling with it for awhile, and then read the comments from other user, and it worked. I am on a Vista machine.
    Thanks for the helpful tips!

  105. Swift says:

    I have Terminal Services Manager installed under Administrative Tools. I highlighted “This Computer” at the top of the list, clicked “Actions” and “Connect to Computer…” and typed in the balky server’s name. The list showing two disconected sessions appeared, allowing me to diconnect them without fully logging into the remote server.

  106. Sofia says:

    Success!

  107. Ylli Chg says:

    thanks very much it works for me

  108. Ravi says:

    it worked great. mstsc /v:ip address /f -admin.

    Thanks for valuable help.

  109. Fuat says:

    Thanks a lot for the information, it saved me a lot of time: the server is 50 miles away: no one around to help me,

  110. Mar Sarreal says:

    Thanks a lot worked in “mstsc /v:ip address /f -admin”

  111. Jagdish Kharmare says:

    Thanks a lot worked in “mstsc /v:servername /f -admin”

  112. orlas says:

    tnks

  113. hemakiran says:

    hi..
    it worked for me perfectly 🙂
    Thnks…

  114. Mayank says:

    Simply click OK to the error message and wait for unto 30 seconds for the window to close then simply type the following in a Start – RUN or CMD Prompt on your client machine.

    mstsc /v:00.00.00.00 /f -console

    Replace 00.00.00.00 with your server’s IP Address or server name. e.g.SERVER

    Type in your administrator password. This will then connect you to the Console Session on the server and allow you to remote control the machine again.

  115. Craig says:

    Thanks, worked a treat!

  116. tkl says:

    Thanks pro

  117. Vlad Mayzel says:

    -console did not work for me.
    -admin WORKED like a charm, and i think more than on Server 2003 – SOLVED.

  118. Deepak Sharna says:

    i am use the server 2003 sp2 only two user allow the access the remote desktop but i wana more then 10 use to access the my server through the my static ip how can it possible to do that please i have very need it

    after the two more user it showt that the above masssage

    ERROR The terminal server has exceeded the maximum number of allowed connections

    how can short out this problem as soon as possible

    thanks

  119. Garfield says:

    Thank you Bobby Ray!!! You saved me from getting a HUGE headache on this one!! The “-admin” switch worked like a charm on 2003 server.

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.