Resetting RDP Sessions for Windows Servers via Command Line

Posted: February 3, 2011 in Uncategorized

I’ve needed this info many times, so I figured I should probably put this down in my blog. If you encounter the error: “The terminal server has exceeded the maximum number of allowed connections” and “The system can not log you on. The system has reached its licensed logon limit. Please try again later. Please try again or consult your system administrator.” while trying to RDP into a Windows Server, that probably means someone closed their connection without logging off first. To get around this, follow the two command prompts below if you have rights. The easiest way to get rights is to map a drive with the administrator permissions.

query session /server:servername

This will provide you a list of  sessions. You should see sessions you can kill such as “rdp-tcp#1”.

reset session 2 /server:servername

This will kill the session associated with that ID which is found in the third column from your query command.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s