solving sql server problems for millions of dbas and developers since 2006



SQL Server DBA Tips SQL Server Developer Tips SQL Server Business Intelligence Tips SQL Server Career Tips SQL Server Tip Categories SQL Server Tutorials SQL Server Webcasts SQL Server Whitepapers SQL Server Tools SQL Server Questions and Answers MSSQLTips Authors About MSSQLTips SQL Server User Groups MSSLQTips Giveaways MSSQLTips Advertising Options

MSSQLTips Facebook Page MSSQLTips LinkedIn Page MSSQLTips RSS Feed MSSQLTips Twitter Page MSSQLTips Google+ Page





Remote Desktop Error terminal server has exceeded the maximum number of allowed connections

By: | Read Comments (7) | Print

Jugal has 8+ years of extensive SQL Server experience and has worked on SQL Server 2000, 2005, 2008 and 2008 R2.

Related Tips: More

Problem

As DBAs, we are supporting production servers as well a number of development boxes. On the development boxes apart from DBAs, developers probably also have Admin rights and may sometimes connect to the server remotely. There could be times when developers or other DBAs are not disconnecting their remote desktop sessions or they are connecting to the server using MSTSC. Due to this, we sometimes get the "The terminal server has exceeded the maximum number of allowed connections" message. 

To resolve this so we can connect, we need to disconnect in-active sessions through terminal service manager, but what can we do in the case where all sessions are still active?  To resolve this you can follow the below simple solution.

Solution

When trying to connect using a remote desktop session you may get this Login Failure Message, because there are too many remote sessions.

When trying to connect using a remote desktop session you may get this Login Failure Message

To resolve the exceeded connection issue execute “mstsc /admin” command from the command prompt as shown below.

 execute “mstsc /admin” command from the command prompt

If a terminal server has exceed the maximum number of sessions an "/admin" session can still be created and this will allow you to still connect to the server.

The /admin sessions don't count towards the session limit that may be configured on a terminal server to limit the number of remote sessions, so this will give you a back door into the server if you get the message "The terminal server has exceeded the maximum number of allows connections".

Next Steps

  • Note that this switch was changed for Windows Server 2008 for earlier versions of Windows you will need to use "mstsc /console"
  • Read more about these changes


Related Tips: More | Become a paid author


Last Update: 4/9/2010

Share: Share 






Comments and Feedback:

Friday, April 09, 2010 - 1:52:52 AM - diebieeee Read The Tip

 True, but keep this in mind when you're on a (db)administrators team: /admin only allows *1* user at a time since this uses the console connection.

 I found that (W2K3 at least) doesn't warn about an already active /admin connection.

If user A is already using this connection and user B runs mstsc /admin then user A is kicked off unceremoniously and user B doesn't get a warning that this will happen/has happened,

 


Friday, April 09, 2010 - 5:59:05 AM - urcuterajendra Read The Tip

Thanks Jugal,

We are getting max connection issue daily, this is the simple solution. 

I am also getting warning for the kicking off another session. 

 


Friday, April 09, 2010 - 6:00:04 AM - DJS Read The Tip

Diebieeee,

I am able to get waring in Windows Server 2003.  When i tried mstsc / admin command, i received warning that "there is already user A is connected to box, would you like to end this(Current) session or not". Command did not kick off user A without the warning.


Friday, April 09, 2010 - 6:08:14 AM - jshah.sqldbpool Read The Tip

This is totally depend on the configuration of WIN2k3, its policies, max connections etc...


Friday, April 09, 2010 - 6:11:01 AM - diebieeee Read The Tip

 That must be a contributing factor, since I'm 100% sure that I did NOT get a warning that another user was connected to the admin connection.

 


Friday, April 09, 2010 - 8:08:44 AM - GaryW Read The Tip

There's also another way I came across some time ago it is very handy.

 Open a command window and type in qwinsta /server:<server name or IP address>

If RDP is running it will show the logged in users and also have an ID (0,1,2, or 3 generally). Note which one you want to disconnect and type on a new line in the command window:

rwinsta /server:<server name or IP address> ID# {for example say it's ID 1 you want to end because it's a disconnected session, you would type in rwinsta /server:myservername 1

The session will end and you can then log in normally.

Of course, you've got to have admin rights to the server or global admin rights to the domain to do it to other servers, but it's another handy method you can use! It still works in Windows 7 and Server 2008 which is also nice!

 HTH!

Gary


Friday, April 09, 2010 - 8:32:10 AM - Chuck Hottle Read The Tip

I usually just log on to a different server and start Terminal Services manager.  From there, you can connect to the server that is maxed out and decide who to kill or contact about logging off.  You can see the date and time of their last activity, so deciding who to logg off is usually pretty easy.



Post a Comment or Question

Keep it clean and stay on the subject or we may delete your comment.
Your email address is not published. Required fields are marked with an asterisk (*)

*Name   *Email   Notify for updates
Comments
*Enter Code refresh code


 
New SQL Monitor v3.0

New SQL Monitor v3.0


Sponsor Information
Try the award winning SQL diagnostic manager as a free 14-day trial!

SQL Monitor, server monitoring so easy, your boss could do it. Try it online.

SQL Servers keeping you up at night? Contact the Edgewood SQL Server consultants for a Health Check.

Get SQL Server Tips Straight from Kevin Kline.

Join the over million SQL Server Professionals who get their issues resolved daily.

Free web casts for DBAs and Developers on Performance Tuning, Development, Administration and more....


Copyright (c) 2006-2012 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | about
authors | contribute | feedback | giveaways | user groups
Some names and products listed are the registered trademarks of their respective owners.


Edgewood Solutions LLC | MSSharePointTips.com | MSSQLTips.com