Something I have been asked about four times in the last week or so is how to log on to a remote server when the following message is displayed:
The terminal server has exceeded the maximum number of allowed connections.
There are two ways of dealing with this.
Both techniques use the command prompt. To connect to the machine from the command prompt, you need to run as an administrator identity on that machine. From the run box or a command prompt, open a new command prompt with:
runas /user:domain\administrator cmd
where domain\administrator is a user with administrator privileges on the target machine.
mstsc
First, try connecting to the console session. From the command prompt, type:
mstsc -v:0.0.0.0 /f -console
Where 0.0.0.0 is the IP address or server name. eg:
mstsc -v:172.21.2.3 /f -console
mstsc -v:machinename /f -console
To connect with an admin session:
mstsc -v:172.21.2.3 /f /admin -console
Once logged on to the session go to the Terminal Services Manager and logoff one of the other sessions. You then need to log off this session as, as a rule, you shouldn't log on to the console session as if the console session cannot be connected to as well you could be in all sorts of difficulty. Once logged off of the console session you can now connect to the freed RDP connection.
query
You can query and reset sessions from the command prompt:
- Find out which sessions are running:
query session /server:machinename
- Reset one of the sessions:
reset session 2 /server:machinename
Note that there is no feedback from the reset command, so a second query command will show you the new status.