Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

Windows Server 2008 Server Core : Managing System Users - Obtaining Session Status Information with the Query Utility

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
3/26/2011 11:51:45 AM
Query provides four different modes that help you discover information about Terminal Server. This utility falls more in line with Microsoft's latest strategy for working with Terminal Server, so you should use it whenever possible in new scripts and batch files. The following sections tell you about the process, session, user, and Terminal Server (TermServer) modes.

1. PROCESS

The PROCESS mode helps you discover information about Terminal Server processes. Every application creates a process when it runs, so this information focuses on the applications that Terminal Server is running. The output information includes the username, session name, session identifier (ID), Process Identifier (PID), and image (application) name. This mode uses the following syntax:

QUERY PROCESS [* | processid | username | sessionname | /ID:nn |
programname] [/SERVER:servername]

The following list describes each of the command line arguments.


*

Displays all of the visible processes.


processid

Displays process information for the specified PID.


username

Displays all of the processes belonging to a particular user. You'll always find processes belonging to your personal account, local account, network service account, and local service account.


sessionname

Displays all of the processes running in a particular session. The two default sessions are console and services.


/ID:
nn

Displays all of the processes running within a particular session. You'll always see two sessions. Session 0 works with the services sessions and session 1 works with the console sessions.


programname

Displays all of the sessions associated with a particular program name. If multiple people are using the same application, you'll see one session for each user.


/SERVER:
servername

Enumerates the specified processes on a particular Terminal Server. If you don't have rights to access the Terminal Server, you'll see a security error message. If the server isn't running Vista, Windows Server 2008 Full version, or Server Core, you'll likely see an "Error Enumerating Processes" message.

2. SESSION

The SESSION mode tells you about the sessions running on Terminal Server. Depending on what command line options you use, you can obtain a wealth of session information. The default settings provide the session name, username, session identifier, session state, connection type, and connection device. This mode uses the following syntax:

QUERY SESSION [sessionname | username | sessionid] [/SERVER:servername]
[/MODE] [/FLOW] [/CONNECT] [/COUNTER]

The following list describes each of the command line arguments.


sessionname

Displays all of the processes running in a particular session. The two default sessions are console and services.

username Displays all of the processes belonging to a particular user. You'll always find processes belonging to your personal account, local account, network service account, and local service account.


sessionid

Displays all of the processes running within a particular session. You'll always see two sessions. Session 0 works with the services sessions and session 1 works with the console sessions.


/SERVER:
servername

Enumerates the specified processes on a particular Terminal Server. If you don't have rights to access the Terminal Server, you'll see a security error message. If the server isn't running Vista, Windows Server 2008 Full version, or Server Core, you'll likely see an "Error Enumerating Processes" message.


/MODE

Displays the current line settings. The output changes to include several new columns including the session name, state, device, type, baud, parity, data bits, and stop bits.


/FLOW

Displays the current flow control settings. The output changes to include several new columns including the session name, state, device, type, and flow control.


/CONNECT

Displays the current connection mode. The output changes to include several new columns including the session name, state, device, type, and connection type.


/COUNTER

Displays three counter settings that include total sessions created, total sessions disconnected, and total sessions reconnected.

3. USER

The USER mode displays information about users logged into Terminal Server. The output information includes the username, session name, session identifier, session state, idle time, and logon time. This mode uses the following syntax:

QUERY USER [username | sessionname | sessionid] [/SERVER:servername]

The following list describes each of the command line arguments.


username

Displays all of the processes belonging to a particular user. You'll always find processes belonging to your personal account, local account, network service account, and local service account.


sessionname

Displays all of the processes running in a particular session. The two default sessions are console and services.


sessionid

Displays all of the processes running within a particular session. You'll always see two sessions. Session 0 works with the services sessions and session 1 works with the console sessions.


/SERVER:
servername

Enumerates the specified processes on a particular Terminal Server. If you don't have rights to access the Terminal Server, you'll see a security error message. If the server isn't running Vista, Windows Server 2008 Full version, or Server Core, you'll likely see an "Error Enumerating Processes" message.

4. TERMSERVER

The TERMSERVER mode outputs information about Terminal Server. The information you receive depends on the Terminal Server you query and the command line options you select. This mode uses the following syntax:

QUERY TERMSERVER [servername] [/DOMAIN:domain] [/ADDRESS] [/CONTINUE]

The following list describes each of the command line arguments.


servername

Specifies the name of the Terminal Server. The system must be running Terminal Server. The Query utility won't return any information, even if you have Terminal Server installed, unless Terminal Server is running at the time of the query.


/DOMAIN:
domain

Specifies the domain to search for Terminal Servers. The Query utility assumes that you want to query the current domain.


/ADDRESS

Adds network and node address information to the output.


/CONTINUE

Displays all of the Terminal Server information as continuous output, rather than pausing after each screen. Use this option when you plan to redirect the output to a file.

Other -----------------
- Windows Server 2008 Server Core : Managing System Users - Managing Group Policies with the GPUpdate Utility
- SharePoint 2010 : Testing Office Web Apps Functionality (part 2)
- SharePoint 2010 : Testing Office Web Apps Functionality (part 1)
- Exchange Server 2010 SMTP Connectors
- Exchange Server 2010 : Transport-Level Security Defined
- Exchange Server 2010 : Exchange Server-Level Security Features
- SharePoint 2010 PerformancePoint Services : Time Intelligence (part 3) - STPS Example
- SharePoint 2010 PerformancePoint Services : Time Intelligence (part 2) - STPS Syntax
- SharePoint 2010 PerformancePoint Services : Time Intelligence (part 1) - Configuring Time Intelligence for an Analysis Services Data Source & Configuring a Tabular Data Source
- SharePoint 2010 PerformancePoint Services : SQL Server Table Data Source
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server