remotely log off terminal services session using CMD prompt

Windows server 2000/2003 allows two remote terminal services connections for administrative purposes.  Every once in a while you might get the message “You exceeded the allowed connection count” message when trying to connect to a server via RDP, because previous sessions were not disconnected correctly. Below are some easy steps to quickly remotely log off a terminal services connection via command line from you PC.

In this example you can see 2 users, Matt and James, that are in a disconnected state and the server will not allow any further connections.

Using 2 commands you can easily remotely log off terminal services connections

Command 1 – qinsta /server:yourservername – this will display the users that are logged in along with their session ID. You can see below that James has the session ID of 2.

Command 2 – rwinsta 2 /server:yourservername – This will log off user with session ID of 2

Leave a Reply