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
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.





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
rawjappoipS said
I agreed with you
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
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)
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/
Vijay said
GUI is of great help thanks a lot!!!
Kevin said
GUI is very helpful, Thanks
pogi said
nice, gui. great help
devil said
mstsc /v:192.168.1.10 /f -console
Arjun Khanal said
You can also use:
mstsc -v:192.168.1.10 /admin
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.
Snow White said
Access your computer from any PC, Mac, iPhone or other mobile device with PCNow http://webex.we.bs/
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
Andrew Tagg said
Errr, so whats the point of a terminal server if only 2 people can connect to it?
Dinesh said
Thanks…Sujeeth ….
Swami said
This article was very very helpful. it saved 30 minutes ($$$$$$$$$$$).
Furkan said
Thx For Info
Furkan
Gilberto said
Thanks it did work for me, thanks
Anonymous said
It really help me.
thank u very much………
Irfan
Anonymous said
Thanks it was a huge help!
Chloe said
I agree with Andrew. How do you increase the limit over 2?
Sujeeth said
After installing the Terminal Services licensing server, you may need to modify the limit. To do that, open Terminal Services Configuration. Right-click on RDP-TCP and select Properties. Click Network Adapter and select Unlimited Connections. By default this will be set to 2 connections.
preet bilga said
its right answer………thnx
okta said
extra ordinary answer :D
Hans said
Thanks a lot – I was out of the country and this was the only way to get back my connection.
Giovanni T said
Thank you! This tip was a great help and saved the day!
Vivek said
Great help on this topic . Thx
kurokana said
Awesome, thanks
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.
Lakshmi said
Thanks a lot Sujeeth…. /admin really helped.
Anonymous said
Thank you Very Much
My problem solved in just 2 minutes
Anonymous said
Hello
My problem solved in just 2 minutes
Great Job!!!!!!!!!
Thank you
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.
Sohail said
Thanks, vista update worked :).
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.
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.
pter said
Hi Sujeeth,
Excellent job consistent, and complete.
You make my day…
Thanks,
ooty said
Grate job. It helped me to login to the server. Thanks
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
Vera said
This was very helpful and appreciated. Thank you.
Anonymous said
Please check this command in RUN
MSTSC /admin
Pat R said
Thank you very much – the command line saved my life :)
Mahi said
thanks
R. Ramesh said
THanks to buttar
Ur help is crystal clear…
Anonymous said
thanks for /admin info.
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
Anonymous said
Thanks a lot, it was short and usefull
cheers
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
Manish said
Thanks Sujeeth. Your Good work was helpful to me as well. Keep up the good work
Vlad Mayzel said
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!
Nizam said
hi all,
please help…
how to get the rdp-tcp#9(in the above picture) ip adddress? what is the command…?
Anonymous said
Excellent information
Hazael Carrillo said
Wow! excelent post!
Anonymous said
those commands work well thanks a lot!!
Anonymous said
this article isn’t work.
Anton said
Thanks for the post, it is what I am looking for.
Anonymous said
thank you! very helpful indeed
Anonymous said
Thanks great article
ganeshl said
Its really work
Thank You very much…
Rozliczenie pit 37 said
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. . . . . .
alarm chicago home security system said
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.
word search puzzles said
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.