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”
Got something to say?
This article will definitely help me out
Thanks a bunch! This was very helpful!
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
thanks man!
Very Helpful. Thank you!
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!
Excellent, this really helped. It got us out a real jam.
Excellent article.
Ya ve just helped me solving one headach pf the day.
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.
Jah… the /console option is available only on 2k3.
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).
Excellent article, this really helped me a lot, as my server was in CA, USA
Gr8 help. Thanx. You need hosting, lemme know
Thanks man. Your advice helped me out.
Really great! Why isn’t Microsoft able to post something like this?
You saved me lots of time.
This is very helpful. Thank you very much
Very useful article!!
Fantastic article, very useful. Many thanks.
Spot on thanks mate (Y)!!
Cheers mate all the bit other article were missing
This article was very helpful!
>I hope the details in this article help someone out!
they realy do ! Thanks
It is really good article. I google a few time to find it.
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
Thank you! Remote server locked out on us. This had helped us immensely!!!!
Is there a way to increase the number of allowed connections past 2?
Very Helpful, thanks !
“Is there a way to increase the number of allowed connections past 2? ”
You need to buy more licenses
Lifesaver
Thank you very much. This really helps …
Good one dude. Nice & easy to read info.
Thanks
Nice article. This solved my problem. Thanks a lot for sharing
Thanks so much for sharing! Saved me a 30 minute drive!
Helpfule immensely
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
You’re great! Thank you very much!
thanks dude u saved my day xd
This doesn’t work on Windows server 2K3 for me. And the server i am adminning is in another country.. what to do?
The [Q/R]WINSTA commands work for me… Best Regards. Thanks
Excellent one…. Life Saver!!!
What abt increasing/ cracking the 2 concurrent user limitation???
Is that possible in the Remote Administration Mode???
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.
Thanks, Really got rid of the issue.
sweet, thanks! only wish I’d searched for this last night when I was waiting for my session to timeout…which it never did.
thanks. i use win2k so i choose the easy way which reboot server then do the Terminal server configuration as you say so.
Finally, I found the right answer here. Thanks
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/
Good article… well written… thanks a ton. Cheers
that is a great tip. i find that my sessions do not fully disconnect even when I click log off
very nice article budddy;
thnx u saved my day;
how to increase more than 2 remote sessions’; to server’?? please tell
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
Thanks a million this information added 10 years to my life. Really screwed up my kids inheritance