Remotely Managing Remote Desktop

Some of my coworkers have an annoying habit of remoting into our Win2k servers and never logging out. They also like to do this in pairs, which means nobody else can remote into the machines due to Microsoft's default two-user administrative mode Terminal Services limit. Yeah, I could rclient in, or use remote MMC snap-ins, but sometimes it's just faster to manipulate the GUI via Remote Desktop.

This is a companion discussion topic for the original blog entry at:

You could also fire up the ts client using “mstsc /console” and kick them off that way. :wink:

You could disconnect them from a command prompt with tsdiscon:
tsdiscon 1 /server:fabrikam

Or reset their session with rwinsta:
rwinsta 1 /server:fabrikam

If you wanted to be picky/choosy about Who you disconnect/reset, you can view session info with qwinsta:
qwinsta /server:fabrikam

A couple other command line tools are tsshutdn (shutdown/reboot machine) and tskill (kill process).

I believe these are all available on Windows XP by default.

Running Terminal Services Manager from my home machine wouldn’t connect to the remote machine. the rwinsta command doesn’t have any facility for entering credentials.

My remote server is hosted by 1and1.

Thank you very much! These commands are VERY useful.

After reading this article looking for a Remote Connection Manager and realizing that the old MS mmc kinda stunk I built a connection manager using .net 2. I hope it can be of use.

you could also logoff a remote TS user:

in cmd do:
quser /server:servername

logoff sessionID /server:servername

quite handy


Thats cool !

Or you can do the following:

query session /server:servername

find the inactive user and then:

logoff usernumber /server:servername

Every command from above in a command prompt and they did not work for booting a user from the server I entered. I am using Windows XP machine to do it with Domain Admin privileges. Any know why it’s not working for me?