Managing Terminal Services Sessions Remotely
page 1 of 1
Published: 12 Jan 2005
Unedited - Community Contributed
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
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 8606/ 12

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:

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

This will display something like this:

qwinsta /server:

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: 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: 2010-03-09 9:13:58 AM
Works great...easy to remember too!
Title: Thanks!!   
Name: Ganesh
Date: 2010-02-11 1:01:31 PM
That's easy. Thanks a lot.
Title: Interesting info   
Name: Hari
Date: 2009-11-13 3:49:40 AM
Title: Fantastic 2   
Name: Shaun
Date: 2009-09-07 8:05:33 AM
Title: Same Username   
Name: nvstrm
Date: 2008-09-01 7:53:59 AM
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: 2008-08-26 11:18:16 AM
Does not work if you are not using the same username/password or on the same domain.
Title: Useful info   
Name: Upendra solige
Date: 2008-06-03 10:07:54 AM
It is very useful to me
Title: Very usefull information   
Name: Rod Medrano
Date: 2008-04-30 5:08:17 AM
I nearly restarted the server which I cannot access

thanks for the info!!!
Title: Saved me a huge trip   
Name: Theo Ekelmans
Date: 2007-08-23 12:03:00 PM

Good post! You just saved me a 3 hour round trip!
Title: Great Tip   
Name: Stan
Date: 2007-07-25 8:47:05 AM
Very, very useful as I have admin that I can't get to log off consistently. Thanks!
Title: Thanks!   
Name: Roman
Date: 2007-05-25 1:04:02 PM
This article is very helpful!
Title: Very Helpful   
Name: Richard
Date: 2006-11-13 8:30:51 AM
This is extremely useful. It saves a lot of time.
Title: SACHIN   
Date: 2006-04-26 1:05:58 AM
HI ,
Title: Also very useful   
Name: majikk
Date: 2006-03-28 8:08:26 PM
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: 2006-03-02 4:29:11 AM
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-2024  |  Page Processed at 2024-04-14 1:10:49 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search