Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


May 1999

9 Undocumented Terminal Server Commands


RSS
Subscribe to Windows IT Pro | See More Thin-Client Devices Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Exploring Terminal Server's most useful command-line utilities

Windows NT Server 4.0, Terminal Server Edition has been available for almost a year, and administrators are fitting the OS into networks throughout the NT world. Microsoft designed Terminal Server to attract Citrix WinFrame users who are looking for an NT 4.0 thin-client product. Terminal Server has succeeded in interesting many WinFrame customers, and it has brought many new administrators into the multiuser-NT fold. (For more information about Terminal Server and WinFrame, see "Related Articles in Windows NT Magazine," page 78.)

Terminal Server includes all of NT's graphical administrative tools. NT's point-and-click utilities, including User Manager, Server Manager, and NT Explorer, make learning to administer Terminal Server systems a breeze. These GUI tools are wonderful for new administrators and small projects, but administrators of large networks need command-line alternatives.

Veteran NT administrators know that one of NT's primary weaknesses is its lack of command-line alternatives to GUI utilities. Administering an NT network from the command line is impossible without Microsoft Windows NT Server 4.0 Resource Kit tools such as Addusers, Rmtshare, and Xcacls. (For information about these utilities, see "AddUsers," May 1998; Reader to Reader, February 1998; and "XCACLS," March 1998.) WinFrame has always offered better command-line tools than NT has offered, and Terminal Server includes much of WinFrame's command-line functionality. As far as I can tell, Microsoft hasn't documented Terminal Server's command-line tools, but as I've hacked around on my Terminal Server systems, I've found some useful utilities. Because I use RDP on my network, I'll cover the Terminal Server commands that work with both RDP and WinFrame's Independent Computing Architecture (ICA) protocol.

See Whether a User Is Logged On
The Query User tool gives you information about users' connections to a Terminal Server system. Want to know whether a user with the NT username janesmith is attached to the server Shipboard? Open a command prompt on any Terminal Server machine in Shipboard's domain, and type

query user janesmith /server:shipboard

If Jane Smith isn't logged on to Shipboard, Terminal Server will respond with the answer "No User exists for janesmith." If she is logged on to Shipboard, you'll get information about her. You'll see her username, her Terminal Server session name (a string such as rdp-TCP#1), her session ID (a number that identifies the session), the number of minutes her session has been idle, and what time she logged on. The session ID that Query User provides is important; you need it to run some of Terminal Server's other command-line utilities.

Query User's syntax looks like

query user [<identifier>] [/server:<server name>]

The identifier variable can be a user's username, session name, or session ID. Any one of these three identifiers gives Query User enough information to find a particular user session. If you type

query user

without an identifier, you'll get a list of the users who are logged on to your server. (You can use an alternative Terminal Server utility named Qwinsta to list all of a server's sessions—including not only active user sessions but other sessions that the system runs for its own purposes.)

Without the /server: parameter, Query User gives you information about the people logged on to the server that you're sitting at. To query a different server, add /server: and the name of the server you want to query. For example, to remotely request a list of the people attached to a server named Pungo, you type

query user /server:pungo

I haven't found a way to ask Terminal Server to search every server in a group for a particular user; telling Terminal Server "See whether janesmith is logged on to any of this domain's Terminal Server systems" seems impossible.

   Previous  [1]  2  3  4  Next 


Top Viewed ArticlesView all articles
10 Reasons to Deploy Windows Vista

The decision to upgrade your XP systems to Vista is simple when you consider features such as easier backup, a great desktop search, and vastly improved security options. ...

10 Reasons Not to Deploy Windows Vista

The decision to upgrade to Vista has to make business sense, but many companies find the costs in training and application compatibility problems outweigh any benefits Vista brings. ...

WinInfo Short Takes: CES 2009 Special Edition

An often irreverent look at some of the week's other CES 2009 news, including covering the Vegas spectacle from the comfort of my own home, Windows 7 public beta, a weird Microsoft song application, Palm Pre, pending Microsoft mobile moves, and much more ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Cloud Computing Forum: Integrating Software, Server and Storage as a Service into Your Enterprise IT Delivery Model

Virtualization Forum: Optimizing Storage, Networks, Desktops, and Security

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing