Any opinions expressed here are my own and not necessarily those of my employer (I'm self-employed).

Mar 26, 2011

Ninja trick: The terminal server has exceeded the maximum number of allowed connections

If you work in an environment where several people fiddle around on the same servers, every once in a while you'll get the message "The terminal server has exceeded the maximum number of allowed connections" when you try to log on to a shared server through Remote Desktop.

In many cases this is because someone is lingering on the server. You could go through the process of figuring out who's logged on and asking them to log out, or kick them from the server. But there's another way.

It's possible to remotely connect to the physical console session on the server (also known as session 0). If someone is already using the console session, you'll learn who's connected and will be asked if you want to disconnect them. Since this feature is only intended for ninja hackers, you'll have to run this from command line.

On Windows 7/2008 Server:
mstsc.exe /admin /v:yourservername
On Windows 2003 server:
mstsc.exe /console /v:yourservername
You probably figured out that the command switches /admin and /console did the trick here. A word of advice, don't share this with your co-workers, you want to keep the console session to your self!

The /admin and /console switches are described in Microsoft's article on changes to remote administration in Windows Server 2008. Also, if you're running Windows Server 2003 or Windows XP it's possible to upgrade to Terminal Services Client 6.0 to get the new and shiny features offered by Remote Desktop on Vista and later.


  1. Also, experiment with

    qwinsta /server:servername.domain
    logoff /server:servername.domain

  2. I was initially using the following ninja hack to access our exchange server via rdp: mstsc.exe/admin/v:[ServerIP]

    It was working at one time, but now I'm receiving the following message:
    https://gyazo.com/e5fffff6a0bc7c2592f94c6b078c6ae7 <== After hitting Ok, the window just closes.

    Is this no longer a viable way of accessing a server from the back door, sorta speak?


    - Jon

  3. One year later...

    Jon add some spaces and it should work: mstsc.exe /admin /v:ServerIP

  4. Next time use this great monitoring application.


Copyright notice

© André N. Klingsheim and www.dotnetnoob.com, 2009-2015. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to André N. Klingsheim and www.dotnetnoob.com with appropriate and specific direction to the original content.

Read other popular posts