Troubleshooting Remote Desktop

Overview

This article outlines how to troubleshoot the following error when trying to Remote Desktop into a server: "The terminal server has exceeded the maximum number of allowed connections". It is adapted from http://www.howtogeek.com/howto/windows/command-line-hack-for-terminal-server-has-exceeded-the-maximum-number-of-allowed-connections/

Procedure

1. Gaining Access

To use the command line hacks, you might need to run them from another server if your local operating system doesn’t include the commands. You will also need to make sure that you are logged onto that server with an administrative account. The easiest way to do that is just map a drive, as follows.

net use /user:[username] \\servername\share

2. Querying Sessions or Users

Querying sessions will give you all sessions (not just user sessions). Querying users will show you Idle Time and Logon Time. Both will show you a Session ID.

query session /server:servername
query user /server:servername

3. Forcibly Logging Off a User

The session-id is from the previous command. This command has no output, but if you query sessions or users again, you will see the specified session-id is gone.

reset session [session-id] /server:servername