Fervent Coder

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

My Links

News


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!

Archives

Post Categories

Image Galleries

Sites

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)

image

 

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):

http://technet.microsoft.com/en-us/library/cc731503.aspx

http://technet.microsoft.com/en-us/library/cc754785.aspx

http://weblogs.asp.net/owscott/archive/2003/12/30/46776.aspx

http://drowningintechnicaldebt.com/blogs/royashbrook/archive/2007/03/29/qwinsta_2C00_-rwinsta_2C00_-and-reg_2C00_-OH-MY_21002100_.aspx

http://www.doering.co.uk/doering/it_pages.asp?page=terminalservices_qwinsta

http://www.notes411.com/dominosource/tips.nsf/0/2913BC501C9F874D802571AA004E9580!opendocument

http://www.tomshardware.com/forum/172235-46-using-qwinsta-drop-terminal-services-sessions

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

Feedback

Gravatar

# 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
Gravatar

# 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
Gravatar

# 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
Gravatar

# 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: