Problem: You’re trying to RDP to a remote server and you get the message “The terminal server has exceeded the maximum number of allowed connections.” You need to be able to examine current open sessions and kill unused ones.
Solution: Open a command prompt from an account with admin privileges. Use the ‘query’ command to find out who has sessions open on the target system:
C:\Users\jholmes>query session /server:myserver SESSIONNAME USERNAME ID STATE TYPE DEVICE console 0 Conn wdcon rdp-tcp 65536 Listen rdpwd schambers 1 Disc rdpwd schambers 2 Disc rdpwd
We can easily see that someone’s hogging up the sole two allowed connections by logging on, then killing the RDP session while still connected. Nervy.
No matter, I can fix that quite easily with the ‘reset’ command:
C:\Users\jholmes>reset session 1 /server:myserver
This kills the session Now I’m able to RDP on to the server without being blocked by someone who wasn’t cleaning up after themselves…