jueves, 28 de diciembre de 2017

Solution: "The terminal server has exceeded the maximum number of allowed connections"

Have you ever seen this error message when trying to remote desktop into your Windows Server?
“The terminal server has exceeded the maximum number of allowed connections. The system can not log you on. The system has reached its licensed logon limit. Please try again later.”
I have seen it a million times. What it means is that you have used up your two remote administration remote desktop connections. Each copy of Windows Server 2003 comes with 2 licenses to be logged in simultaneously for administration purposes. So how do you log someone out if  you can not log in? Do I really have to walk over to the server room?  The answer is no and chances are those logged in users are just connections that have timed out or have been aborted. Always remember to log out when you are finished with your remote desktop connection.
If you are working in a domain enviroment you can just connect to another server that is in the same domain and open up your MMC console. We want to launch the Terminal Server Manager.
Once you launch the Terminal Server Manager we need to go to the file menu and connect to another server. Choose your server from the list of available terminal servers or type in your servers name. Then you will be able to right-click on the connection in question and log them off.
If you are not luck enough to be in a domain then we need some Admin magic. You will need to be logged in with an account that has administrative access to the machine in question. A domain administrator is your best bet if you are not sure about security. Then you will have to drop to a command line ( Start / Run / CMD ). If you are not logged on as a domain administrator or an administrator of the server in question you can create a short cut to the command prompt and then choose who it runs as by right clicking on the shortcut, choosing properties and then selecting the domain administrator as the user who you want to run the shortcut as.
Once you have to command prompt open we will need to run this command:
query session /server:servername
If you do not have the command query installed you can either copy it over from one of your server, run the command from that server or install Microsoft’s Server Tools on your machine.
After running the command you will see all the logged in sessions and their session ID’s. This is the number that we will need to kill the session. The remote sessions will say RDP in the left column. The line that says console is the session logged on at the physical console.
The command you will need to run to kill the session is:
reset session [ID] /server:servername
Just replace [ID] with the id from the last step and hit enter. There are NO BRACKETS around the ID. That’s it you will now be able to log in to your server remotely.
One final option that only works sometimes is using this command from the machine you are connecting from:
mstsc /v:servername /console
That will allow you to grab the console session. You will need the username and password that was used to log into this session.