Have you ever come across the error message “The terminal server has exceeded the maximum number of allowed connections” while trying to login to a Windows machine as an administrator?
The error message is displayed as Windows only allows two remote terminal services sessions for an administrator. Sometimes the error message is displayed even though there is only a single active session. The other session could be an hanging session that could have been disconnected in an abrupt manner.
If the Windows server is part of domain, just open the Terminal Services Manager to remove the invalid sessions. If the server is not part of a domain, you will need to connect to the machine locally or via telnet or ssh. Once logged in, run the following command to list the sessions:
1 2 3 4 5 6 |
c:\> query session SESSIONNAME USERNAME ID STATE TYPE DEVICE >console 0 Conn wdcon rdp-tcp 65536 Listen rdpwd Administrator 2 Disc rdpwd rdp-tcp#3 administrator 3 Active rdpwd |
Do you notice that the session with an ID number of 2 is disconnected ?
We can now proceed to remove that session.
1 |
c:\> reset session 2 |
The offending session should now be closed. You can run the query
command again to confirm that the session has been closed.