Terminal Services for Remote Administration third connection refused

I keep a Windows Server 2003 virtual machine around as a workstation for administrators. Rather than installing the Support Tools, Exchange Tools, Communicator Tools, etc on all machines we just install them here and connect when we need to use them. A couple of us use Linux on the desktop too, so it makes it easier than maintaining multiple local virtual machines. It’s also great when you’re on the road and need access to these tools.

When Terminal Server is in Remote Administration mode, you’re only allowed two connections. If you disconnect, you can reconnect elsewhere but sometimes you forget. Or two administrators have left themselves logged in and you can’t get in. Normally you can use ‘mstsc /console /v:hostname’ or ‘rdesktop -0 hostname’ to connect to the console (aka session 0), where you can then use the task manager or the terminal services configuration mmc applet to logoff or disconnect a session. For a while now, every third attempt to connect has gotten “ERROR: recv: Connection reset by peer” from rdesktop or a similar error from mstsc which I’ve since lost. Wireshark shows a TCP handshake, the client sending a packet of data, and the server replying with an RST.

I eventually found the solution. If you’ve ever adjusted the ‘Maximum Connections’ value on the ‘Network Adapter’ tab of the ‘RDP-Tcp’ properties in Terminal Services Configuration, you may have inadvertently change this setting from it’s default of ‘ffffffff’ to ‘2’, which is the maximum value the UI will take. You can set this value back to ‘ffffffff’ via regedit by editing this key:

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\MaxInstanceCount

I believe I had to reboot after doing so.

1 thought on “Terminal Services for Remote Administration third connection refused

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.