Logoff Remote Desktop Session Remotely

I’ve been working for a client where I’m connected to their VPN much of the day working remotely on machines located at the clients site. Occasionally, I’ll run into a Remote Desktop connection limit where I can’t login and infrequently, one of the logged on sessions will be my own. At that point, I’ll occasionally try using mstsc.exe with a /console switch to try and disconnect an inactive or unused session but in this instance I was getting this error:

This computer can’t connect to the remote computer.

The next thing is to try and logoff the session remotely using two Windows utilities, quser.exe and logoff.exe. With quser you can find out the session names of the logged on users and use that information in a subsequent call to logoff.exe to close the session.

Console output of quser.exe and logoff.exe

At this point, I can successfully log back in using Remote Desktop or my current favorite remote client Terminals.

4 thoughts on “Logoff Remote Desktop Session Remotely

  1. Hey Steve,
    I didn’t know about quser.exe and logoff, is that from Server 2003 Admin Tools pack? What I like about qwinsta and rwinsta is that it comes with Windows XP and when I’m helping my QA department, they can get out of jam without installing anything. It looks like you get more information from quser than from qwinsta, specially the idle time.

  2. Hey Steve,
    I might help if I actually check my filesystem a little closer. I found quser.exe hiding in \windows\system32\dllcache. I wonder why it wasn’t in system32?

Comments are closed.