Terminal server has exceeded the maximum number of allowed connections

Have you ever gotten this error?

“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.”

It’s because Windows only allows two remote terminal services connections when you are in administrative mode, and you’ve either got two people already on that server, or more likely, you’ve got a disconnected session that still thinks it is active.

Here is a series of commands to remotely disconnect one of those sessions off.

First, see who is logged into the server.

You’ll want to log into another server on the same network (with administrator credentials) and run the following command:

query session /server:servername

(“servername” is where you would enter the remote servers name)

Below is a sample of what the output would be.

Now you look at the ID and see which session you need to disconnect. In the example above you want to disconnect session 2.

Next is the command to remove the session.

Run the command below to disconnect the session:

reset session [ID] /server:servername

This will take about 20 seconds to run and will not show any output, but if you run the query session /server:servername  command again that session will be gone and you will be able to log into that remote server.