Hardware

Terminal server command line time-saving options

Command line finesse is an indicator of an administrator's competency. Learn some of the commands terminal services on Windows Server 2008 that are handy for troubleshooting.

The Windows Terminal Server platform is a very versatile environment for remote administration and for user access. The tools in Windows to monitor terminal services are good, but if a number of tasks need to be performed; the console tools can be rather clunky.

Windows provides a number of command line tools to gather information on active terminal services operations. TechNet has these command enumerated for use on Windows Server 2008 and Windows 7 systems in the Terminal Server Command Line reference. This resource has a number of commands identified for terminal services tasks.

One command that can quickly provide terminal services information on active sessions on a server is the quser or the query user command, which shows who is connected and their state. Both of these commands with the same results are shown in Figure A. Figure A

Click the image to enlarge.
Another handy task is to reset a session on a terminal server possibly for an idled session or a locked up user; this can be done with the reset session command. A remote server can be specified in the command as well. Figure B shows session ID 2 being removed from a remote server named FA4. Figure B

Click the image to enlarge.

Another handy tool is the tskill utility, which allows a task to be killed on a remote server within a terminal session; this is very beneficial to preserve user password integrity. The msg command can also pass information to a session to inform a user to log out for maintenance.

In each of these cases, the command line options will save you  time compared to performing equivalent tasks within tools such as the Remote Desktop Services Manager or Remote Desktop Session Host Configuration.

Have you leveraged these command line tools to support or troubleshoot terminal servers? Share your comments and strategies.

About

Rick Vanover is a software strategy specialist for Veeam Software, based in Columbus, Ohio. Rick has years of IT experience and focuses on virtualization, Windows-based server administration, and system hardware.

3 comments
djpearce
djpearce

I never knew of the cmd line option. Yet I have used TS monitor with satisfaction.

nick.ferrar
nick.ferrar

I can click a mouse button a few times far quicker than I can recall and type in those commands. To me command line is for scripting, anyone who uses the command line for interactive stuff rather than the GUI is either in a very niche role, has an amazing memory or is simply trying to make themselves look more competent just for the sake of it...

chrishardess
chrishardess

Another cmd line that I have found useful is the shadow Cmd. After Query User gives you the session number. Then the command is 'Shadow 1' (the number being the session number). You can then watch exactly how that expensive consultant is fixing your problem so you dont have to call him next time! :-)

Editor's Picks