Ingo Rammer's Weblog: Remotely disconnecting a Terminal Services Session
Remotely disconnecting a Terminal Services Session
October 05, 2003 09:06 PM

As some of you know, I'm a DIY system administrator for my own network and internet server. This means that I'm far from any MCSE when it comes to all the tricks of the trade of managing Windows Servers.

Today, I finally found a solution to a problem which has been bugging me for ages: As most of you definitely know, Windows 2000 Server allows you to use 2 terminal services connections for administrative purposes. The problem starts when you are - as I am - a road warrior, usually connecting to the internet via some unreliable means like modems, GPRS, or WLAN at hotels. In this case, you will from time to time experience connection drops which can not be recovered so that the server still thinks that you are actually online. The problem now starts as soon as this happens twice in sequence without you being able to disconnect the session in the meantime: "You exceeded the allowed connection count". It's also unfortunately impossible to use the services MMC snapin to remotely stop/restart Terminal Services (even though it seems to be possible for nearly every other service).

That's the point in time when the console tools "qwinsta" (Query Window Station) and "rwinsta" (Reset Window Station) which are included even with Windows XP come into play. After authorizing at your server (f.e. by connecting to a share, etc.), you can run "qwinsta /SERVER:<server>" to enumerate all window stations and "rwinsta <id> /SERVER:<server>" to remotely disconnect a terminal services session.

Might come in handy at some point in time.