Terminal server has exceeded maximum number of allowed connection

January 6, 2006

I’m hosting this site and many other small sites from a web server at my house over DSL with a static IP address. For the most part, it is just me doing the server administration and tinkering. However, every now and then Brian needs to get on the box to do some configuration of his sites. Unfortunately, lately he has been getting plagued with the “Terminal server has exceeded maximum number of allowed connection” message when he tries to connect with Remote Desktop. Of course, I’m to blame because I typically have a Remote Desktop connection from my desktop at home and from my desktop at work. Since I tend to do little changes here and there between tasks, I usually leave Remote Desktop connected so that I can jump in and out. Especially if I’m making changes to WordPress, I’ll leave the text editor and file explorer open for a couple days in a row.

However, due to our pending release of MyHomePoint and the fact that Brian is carrying the majority of the weight right now, he needs access to the server more and more these days to do releases, testing, etc. And of course, he keeps getting denied access to the server due to my bad habits. I knew there was a limit on the number of connections allowed and I’m sure that there was a way to control the expiration of those sessions. Of course, a quick check on Microsoft’s site found this Knowledge Base article: Error Messages Generated When Logging on with Terminal Services Client. Of course, the description didn’t really give me much more to go on to solve the problem:

Description: The user is attempting to log on to a Terminal Server in Remote Administration mode, but the server has reached its connection limit. Terminal Servers in Remote Administration mode allow a maximum of 2 concurrent sessions, active or disconnected.

After a little more digging and Googling, I ran across a forum thread with some more information and some solutions.

First, if your two primary connections to the server are locked out, you can still access the server console from your command line with the following command:

(Of course you would replace 0.0.0.0 with the correct IP address of the server) This will essentially give you a third remote connection to the server. You should probably only use this connection to jump in and kick off existing connections. If bad habits got you into the problem in the first place, the last thing you need is for your contingency connection to be locked as well. You can delete existing connections by going to Start > Control Panel > Administrative Tools > Terminal Services Manager. Once that window opens, expand the This Computer node in the left-hand panel. The next node should be an entry for your server. Click on your server name and notice that the panel on the right-hand side has tabs for Users, Sessions, and Processes. Click on the Users tab and you should see all existing connections. Some of the icons for the connections may be greyed-out to indicate that the session has expired. These are the sessions that are taking up connections unnecessarily. Right-click on the user/session that is no longer needed and select “Log Off” from the bottom of the list. This kills that user/session and frees up the connection. The other options (like Disconect) don’t actually free up the connection.

The second bit of interesting information from the thread was you can configure the settings on terminal server to manage the connections in a variety of ways. You do that through Start > Control Panel > Administrative Tools > Terminal Services Configuration. Select the Connections folder from the left panel. In the right panel you should see the available connection types. Most likely there will be an entry for RDP-Tcp (Microsoft RDP 5.2). Right-click on that entry and select Properties. Select the Sessions tab and you will see a number of options related to sessions. All of my dropdowns were set to Never, which explained why they never timed-out. To solve our problem, I checked the ‘Override user settings‘ option and set ‘End a disconnected session’ and ‘Idle session limit’ to 15 minutes. I left the ‘Active session limit’ at Never since as long as you are actively using the connection, then I don’t really care how long you’ve been on.

I know these settings apply to Windows Server 2003 Standard Edition. They may or may not apply to other versions. I hope the details in this article help someone out!

Popularity: 94% [?]

Comments

52 Responses to “Terminal server has exceeded maximum number of allowed connection”

  1. Brian on January 7th, 2006 10:59 pm

    This article will definitely help me out ;)

  2. BM on January 24th, 2006 2:03 pm

    Thanks a bunch! This was very helpful!

  3. catalin on January 24th, 2006 3:17 pm

    Hi there,

    Now found it out about this command line and it’s useful to know it.

    Actually this command connects you to server like you physicaly are in front of the server’s console.

    Before this i used tsadmin tool (connecting to a server from same domain, running start->run tsadmin to see all open sessions from a server) to kick off the disconnected or idle sessions to allow my remote connection to a server and many times i kicked off admi users that leaves the connections suspended without know it they were running jobs that takes hours.

    Now the problem is solved with this mstsc v:ip_address /f -console command line.

    thx

    Best regards,
    Catalin

  4. peter on January 27th, 2006 12:28 am

    thanks man!

  5. Dir on January 30th, 2006 12:58 pm

    Very Helpful. Thank you!

  6. Mark on February 1st, 2006 9:08 am

    I got my hopes up when I read
    “Actually this command connects you to server like you physicaly are in front of the server’s console.”

    This is not true though. I have tried this out and there are still some applications that I can use whilst actually being at the box but not use when using RDC.
    Sorry to go off topic slightly.

    This is a very handy article!

  7. Eric on February 2nd, 2006 8:06 am

    Excellent, this really helped. It got us out a real jam.

  8. Tim on February 6th, 2006 2:02 pm

    Excellent article.

    Ya ve just helped me solving one headach pf the day.

  9. Paul on February 14th, 2006 10:22 am

    mmm, our servers are Win2k, and this DOESN’T work - I still get the connection limit problem.

    Normally I can see the server from tsadmin running remotely and kill the session remotely, but today it’s conspiring against me. If only you could force tsadmin to connect to a specific machine…

    ho hum.

  10. Layer3 on February 28th, 2006 8:46 am

    Jah… the /console option is available only on 2k3.

  11. Keith on March 2nd, 2006 11:39 am

    You can also try using:

    QWINSTA /server:0.0.0.0
    (Query WINdows STAtion)
    This returns a list of all sessions for the server in question

    RWINSTA /server:0.0.0.0 2
    (Reset WINdows STAtion)
    This will log off the user in the specified session (in this case #2).

  12. Shankar on May 20th, 2006 6:20 am

    Excellent article, this really helped me a lot, as my server was in CA, USA

  13. Vin on May 24th, 2006 7:01 am

    Gr8 help. Thanx. You need hosting, lemme know ;-)

  14. Asim on June 15th, 2006 6:54 pm

    Thanks man. Your advice helped me out.

  15. Miker on August 30th, 2006 1:37 am

    Really great! Why isn’t Microsoft able to post something like this? :(

    You saved me lots of time. :)

  16. Venkat on September 22nd, 2006 5:56 am

    This is very helpful. Thank you very much

  17. Raghu on October 12th, 2006 3:21 am

    Very useful article!!

  18. David Smith on November 1st, 2006 8:38 am

    Fantastic article, very useful. Many thanks.

  19. Azz on November 2nd, 2006 7:18 am

    Spot on thanks mate (Y)!!

  20. Donovan on January 3rd, 2007 8:31 am

    Cheers mate all the bit other article were missing

  21. Jason on January 25th, 2007 8:08 am

    This article was very helpful!

  22. Alex on February 19th, 2007 3:52 pm

    >I hope the details in this article help someone out!
    they realy do ! Thanks

  23. lisa zhang on May 2nd, 2007 2:50 pm

    It is really good article. I google a few time to find it.

  24. Jeremy Holbrook on May 15th, 2007 12:56 pm

    Hi,

    This is a great article! It has helped us immensely. We are new at using Remote Desktop at I wasn’t sure how to get rid of the sessions so we were rebooting the machine which is our customer server so it was a very big problem. Thank you for your posting and great information.

    Jeremy

  25. Andrew on May 17th, 2007 2:05 am

    Thank you! Remote server locked out on us. This had helped us immensely!!!!

  26. Libby Jones on June 13th, 2007 12:11 pm

    Is there a way to increase the number of allowed connections past 2?

  27. Anonymous on June 19th, 2007 2:41 am

    Very Helpful, thanks !

  28. Carlos on July 6th, 2007 3:06 pm

    “Is there a way to increase the number of allowed connections past 2? ”

    You need to buy more licenses

  29. Jacemo on July 30th, 2007 1:23 pm

    Lifesaver

  30. Abdul Shad on August 16th, 2007 3:08 am

    Thank you very much. This really helps …

  31. jaZZy on August 25th, 2007 2:29 am

    Good one dude. Nice & easy to read info.

    Thanks

  32. Shahzad Raja on August 27th, 2007 10:58 pm

    Nice article. This solved my problem. Thanks a lot for sharing

  33. Mike on August 31st, 2007 7:30 am

    Thanks so much for sharing! Saved me a 30 minute drive!

  34. sky Zhang on September 6th, 2007 2:19 am

    Helpfule immensely

  35. Luke on September 13th, 2007 1:41 pm

    Just an FYI. This does not work in Longhorn (Windows Server 2008). You can only have 2 maximum connections in Longhorn, the -console command is basically ignored.

    PS. We did post it :) http://technet2.microsoft.com/windowsserver/en/library/f47ce263-f72e-469d-bf14-6605b7f4cce51033.mspx?mfr=true
    http://support.microsoft.com/kb/278845

  36. Anonymous on November 6th, 2007 3:07 am

    You’re great! Thank you very much!

  37. pyro on December 5th, 2007 4:44 pm

    thanks dude u saved my day xd

  38. damian on December 10th, 2007 9:19 am

    This doesn’t work on Windows server 2K3 for me. And the server i am adminning is in another country.. what to do?

  39. Shawn on January 3rd, 2008 6:09 pm

    The [Q/R]WINSTA commands work for me… Best Regards. Thanks

  40. Saravanakumar on January 9th, 2008 3:14 am

    Excellent one…. Life Saver!!!

  41. Ravz on February 15th, 2008 5:32 am

    What abt increasing/ cracking the 2 concurrent user limitation???
    Is that possible in the Remote Administration Mode???

  42. prasys on March 5th, 2008 4:19 am

    Thank You dude. You have just saved my life. I was stucked and bam didn’t know what to do. Nearly wanted to call my data centre for them to disconnect me.

  43. Jyothi on June 18th, 2008 1:49 am

    Thanks, Really got rid of the issue.

  44. justin on June 25th, 2008 3:57 pm

    sweet, thanks! only wish I’d searched for this last night when I was waiting for my session to timeout…which it never did.

  45. init on July 8th, 2008 4:39 am

    thanks. i use win2k so i choose the easy way which reboot server then do the Terminal server configuration as you say so.

  46. Hooman Iran on August 5th, 2008 7:04 am

    Finally, I found the right answer here. Thanks

  47. Jon on September 2nd, 2008 12:47 pm

    I have written a GUI that allows you to kill open sessions 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/

  48. Hudson LEE on September 5th, 2008 5:16 am

    Good article… well written… thanks a ton. Cheers

  49. Bed and Breakfast in Nenagh on October 7th, 2008 7:12 am

    that is a great tip. i find that my sessions do not fully disconnect even when I click log off

  50. Nafees on October 22nd, 2008 1:47 am

    very nice article budddy;

    thnx u saved my day;

    how to increase more than 2 remote sessions’; to server’?? please tell

  51. Alexander on November 1st, 2008 2:25 am

    Thank Tou!
    Useful article!

    Does anybody know how to increase the number of concurrent connections?
    Is the only way to bye licenses?

    Thank You in advance,
    Alex

  52. Keith on November 21st, 2008 6:52 am

    Thanks a million this information added 10 years to my life. Really screwed up my kids inheritance

Got something to say?





MyHomePoint

Having trouble keeping track of everything going on at home? Is the refrigerator organizer not cutting it anymore? We feel the same way...
Check out MyHomePoint »

Close
E-mail It