Managing Terminal Services Sessions Remotely
page 1 of 1
Published: 12 Jan 2005
Unedited - Community Contributed
Abstract
How to overcome some of the limitations of the 2 user limit in Terminal Services administration mode. In Windows 2000 I use Terminal Services in Administration mode and in Windows 2003 I use Remote Desktop. Basically this is the same thing but it's packaged a bit differently on the two OSes
by Web Team at ORCS Web
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 41240/ 28

How to overcome some of the limitations of the 2 user limit in Terminal Services administration mode. In Windows 2000 I use Terminal Services in Administration mode and in Windows 2003 I use Remote Desktop. Basically this is the same thing but it's packaged a bit differently on the two OSes. In both situations there are only 2 users allowed for administration so occasionally both are used up and I can't access the server. This may happen if two people are legitimately using the servers or if someone forgot to log off. Yes, I do have the settings set to automatically disconnect and/or log off a user after X minutes of inactivity but even with that there are times when I need to be able to manage this remotely.

You would think this would be as easy as connecting to the remote server by adding the Terminal Services Manager snap-in to a MMC console or remotely stopping and starting the service (in a pinch). Strangely these obvious solutions aren't available. Terminal Services Manager doesn't exist as a snap-in to connect to a remote machine and because the TermService service is a core system service, you can't even stop it on the local machine, let alone a remote one.

Fortunately there is an easy solution. Windows 2000+ (includes Windows XP and 2003) have two command-line tools called qwinsta and rwinsta that can query and reset remote session.

For example, let's say that I can't gain access to a server using Terminal Services because both sessions are used up. I can use another server to check the status of the first one. As long as the logged in user has administrative rights on the non-accessible machine I would run this:

qwinsta /server:12.12.12.12

Where 12.12.12.12 is the IP address or name of the non-accessible machine.

This will display something like this:

qwinsta /server:12.12.12.12

SESSIONNAME USERNAME ID STATE TYPE DEVICE
console   0 conn wdconn
rdp-tcp   65536 Listen rdpwd
rdp-tcp#470 Bob 1 Active rdpwd
rdp-tcp#471 Jane 3 Active rdpwd

Now I know that Bob and Jane are the two that are logged in. Since Jane left the office 20 minutes ago I know that she forgot to log off. I don't know where Bob is but I only need one session so I'll ignore him for now.

To disconnect Jane's session I would type this:

rwinsta /server:12.12.12.12 3

Notice the 3 which is the session ID I found from using qwinsta above.

Yet another option with Windows 2003 is a new feature that lets you connect to the desktop directly and gain a 3rd session.

If you're like me, you probably noticed that rwinsta and qwinsta seems like strange names. This came from the Citrix Metaframe days which Terminal Services has descended from. It stands for:

qwinsta = Query WINdows STAtion
rwinsta = Reset WINdows STAtion

One final comment. Microsoft has replaced these two tools with Query but since qwinsta and rwinsta is fully compatible with W2K WinXP and W2K3 I choose to use it instead.

By Scott Forsyth, Director of IT at ORCS Web, Inc. - a company that provides managed hosting services for clients who develop and deploy their applications on Microsoft Windows platforms.



User Comments

Title: Thanks!   
Name: MIS
Date: 3/9/2010 9:13:58 AM
Comment:
Works great...easy to remember too!
Title: Thanks!!   
Name: Ganesh
Date: 2/11/2010 1:01:31 PM
Comment:
That's easy. Thanks a lot.
Title: Interesting info   
Name: Hari
Date: 11/13/2009 3:49:40 AM
Comment:
Nice...
Title: Fantastic 2   
Name: Shaun
Date: 9/7/2009 8:05:33 AM
Comment:
\
\
\
Title: Same Username   
Name: nvstrm
Date: 9/1/2008 7:53:59 AM
Comment:
What if a system has 3 administrators and two of them are
logged in.

rdp-tcp#19 Administrator 1 Active rdpwd
rdp-tcp#20 Administrator 3 Active rdpwd

How to know which one is which ?
Title: Only on authenticated servers   
Name: Yeorwned
Date: 8/26/2008 11:18:16 AM
Comment:
Does not work if you are not using the same username/password or on the same domain.
Title: Useful info   
Name: Upendra solige
Date: 6/3/2008 10:07:54 AM
Comment:
It is very useful to me
Title: Very usefull information   
Name: Rod Medrano
Date: 4/30/2008 5:08:17 AM
Comment:
I nearly restarted the server which I cannot access

thanks for the info!!!
Title: Saved me a huge trip   
Name: Theo Ekelmans
Date: 8/23/2007 12:03:00 PM
Comment:
Woot...

Good post! You just saved me a 3 hour round trip!
Title: Great Tip   
Name: Stan
Date: 7/25/2007 8:47:05 AM
Comment:
Very, very useful as I have admin that I can't get to log off consistently. Thanks!
Title: Thanks!   
Name: Roman
Date: 5/25/2007 1:04:02 PM
Comment:
This article is very helpful!
Title: Very Helpful   
Name: Richard
Date: 11/13/2006 8:30:51 AM
Comment:
This is extremely useful. It saves a lot of time.
Title: SACHIN   
Name: SACHIN BHANGALE
Date: 4/26/2006 1:05:58 AM
Comment:
HI ,
GOOD ID\EA
Title: Also very useful   
Name: majikk
Date: 3/28/2006 8:08:26 PM
Comment:
My clients are continually locking themselves out of there servers and remote desktop and this will help me support to reset the systems.
Title: Very very usefull - thanks a lot!   
Name: Svetoslav
Date: 3/2/2006 4:29:11 AM
Comment:
I landed in a similar situation - only I forgot to logoff previous 2 times and there were no time limits for sessions (did not set them up :( ), so you can't imagine how helpful was this reading!

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2014 ASPAlliance.com  |  Page Processed at 8/28/2014 5:05:58 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search