14

We use Windows "Remote Desktop" to log into server machines. At the moment, I am getting the following error message:

The terminal server has exceeded the maximum number of allowed connections.

Now, the cause is obvious (2 other people are logged on right now!). I recall that in the past I solved this by logging on to some other machine in the same domain and then going to some admin tool which I cannot recall. From there I could see who was logged in and remotely terminate their session (assuming I had sufficient privileges) -- thereby freeing up one of the connections.

Does anyone know how to do this?

mcherm
  • 299
  • 1
  • 3
  • 8

6 Answers6

22

You can use Terminal Services Manager under Administrative Tools.

If you prefer a command-line solution, you can use this to list RDP sessions:

query session /server:servername

To reset a session, look for the relevant session ID in the "ID" column of the output from the above command, then use:

reset session <sessionid> /server:servername
ThatGraemeGuy
  • 15,473
  • 12
  • 53
  • 79
  • When you reset a user's session, all of the programs that are currently running are closed and the session is immediately terminated. To simply disconnect the user use `tsdiscon /server:servername` which will leave their programs running and allows them to pick up where they left off when they reconnect later. – Tim Lewis Jan 14 '15 at 17:01
10

Also keep in mind that even though the remote server is not letting you RDP in normally, you can still hijack the console remotely:

To RDP to the Console of your remote server: from your client PC, open the CMD prompt and type: MSTSC /ADMIN (or if you are using an older RDP client, use MSTSC /CONSOLE)

This will allow you to remote logon to the console (and if necessary boot off anyone currently logged onto the console) - then you can use the Terminal Services Manager or Reset Session commands to boot off other RDP users...

ChrisNZ
  • 606
  • 2
  • 9
  • 25
  • 1
    Super kawaii! This worked even when the `query session` answer by ThatGraemeGuy complained about some RDP error. – Mike S Sep 01 '16 at 14:02
2

What you want is Terminal Services Manager

Ron
  • 137
  • 2
-1

You can also log via console using rdp and boot the users.

Keiran Holloway
  • 1,146
  • 6
  • 13
-1

Also, terminal services licenses are reasonably inexpensive. If you switch to licensed mode, you can tell the server how many licenses you have, and it'll accept up to that many connections.

Note that terminal services licensing was on the honor system last time I checked (ie, the Windows Server doesn't actually check your license keys, it just takes your word for it that you have however many you tell it you have), but that's neither here nor there. ;)

Graeme
  • 343
  • 1
  • 6
  • 1
    Not true. Terminal services licensing requires you to enter a valid key and activate each set of licenses. You also have to be running in Terminal Services Application Mode to utlized them. – Erik Funkenbusch Nov 05 '09 at 21:35
  • Switching to application mode is not always desirable. – John Gardeniers Nov 05 '09 at 22:19
  • Hrm. Last time I set up Application Server on 2003, it definitely didn't validate or verify the licenses, you could just bump up the number and it would happily give you more connections. We didn't exploit that since we had a good deal on the terminal services licenses anyways. Why is the switch to application mode undesirable, apart from having to actually buy more licenses. – Graeme Nov 06 '09 at 16:19
  • Changing the institutional policy for how servers is managed is simply not an option for me, regardless of whether this would work. – mcherm Nov 09 '09 at 13:51
-4

you can also go to the CMD prompt and type "mstsc /v: 00.00.00.00 /admin" -- replace the 0's with your target IP