Fervent Coder

Coding Towards Utopia...by Rob Reynolds
posts - 278 , comments - 431 , trackbacks - 0

My Links


Rob Reynolds

Subscribe to Fervent Coder RSS
Subscribe to Fervent Coder by Email

About Me

I manage several open source projects. Need...
   ...package management for Windows?
   ...automated builds?
   ...database change management (migrations)?
   ...your application to check email?
   ...a monitoring utility?

I also write for

Like what you are reading? Want to buy me a cup of coffee?
PayPal - The safer, easier way to pay online!


Post Categories

Image Galleries


Magic Windows Trick: Query and Reset Terminal Sessions

Have you ever tried to remote into a windows machine and couldn't because the machine had exceeded its available sessions? Can't RDP into a machine because there are already 2 active sessions? Want to play party tricks on your friends and wow them with your "techie-ness?!"

Say hello to my little friends qwinsta and rwinsta (AKA query session and reset session, respectively)



The Disappearing Session Magic Trick

Open a command line. Find the computer in your network you want to query. Type this, smile, and have a coke:

qwinsta /server: serverName

Now find the session ID for which you want to reset the session (AKA boot the user!) under the ID heading. Issue this sweet mother of a command:

rwinsta sessionId /server: serverName

Wait a few moments while it does it's thing. When the command line comes back type:

qwinsta /server: serverName

Tada! That user is gone. Possibly upset, too. Hopefully they weren't working on anything important! Otherwise now is the time to play the blame game and point to all of your other co-workers!

Notes: You must have admin rights to the remote server.

Disclaimer: Use responsibly. I am not responsible for lost time/work/etc.  You accept all responsibilities when using this information. I reserve the right to make up other legal jargon at a later time to get me out of legal issues for something you did because you read this. Just because I give you the gun and bullets doesn't make me responsible for you shooting someone. Seriously, have you read most disclaimers lately? Have a sense of humor already. Are you still reading this?!

References (and others too countless to reference):








Print | posted on Tuesday, August 26, 2008 9:06 PM | Filed Under [ ApplicationsToysOther ]



# re: Magic Windows Trick: Query and Reset Terminal Sessions

Haha...definately going to have to pull this one out on some coworkers.

8/26/2008 10:17 PM | Tim Barcz

# re: Magic Windows Trick: Query and Reset Terminal Sessions

Simon says qwinsta is Query WINdows STAtion.
rwinsta == Reset WINdows STAtion.

You be the judge.
8/26/2008 10:19 PM | Robz

# re: Magic Windows Trick: Query and Reset Terminal Sessions

Check out Terminals on CodePlex. It manages multiple remote desktops, plus it can manage those orphaned session from the UI.
8/27/2008 9:47 AM | Robert Cannon

# re: Magic Windows Trick: Query and Reset Terminal Sessions

@Tim: Awesome!!

@Robert: Thanks, man! I will have to check that out!
8/27/2008 6:37 PM | Robz
Comments have been closed on this topic.

Powered by: