Query process

Displays information about processes running on a terminal server. You can use this command to find out which programs a specific user is running, and also which users are running a specific program.

Syntax

query process [{ *|ProcessID|UserName|SessionName|/id:nn|ProgramName}] [/server:ServerName] [/system]

Parameters

* : Lists the processes for all sessions.

ProcessID   : Specifies the numeric ID identifying the process you want to query.

UserName   : Specifies the name of the user whose processes you want to list.

SessionName   : Specifies the name of the session whose processes you want to list.

/id: nn   : Specifies the ID of the session whose processes you want to list.

ProgramName   : Specifies the name of the program whose processes you want to query. The .exe extension is required.

/server: ServerName   : Specifies the terminal server whose processes you want to list. If unspecified, the server where you are currently logged on is used.

/system   : Specifies that current information about system processes is displayed. If you do not want system processes to be displayed, do not use this parameter.

/?   : Displays help at the command prompt.

Remarks

  • Administrators have full access to all query process functions.

  • If you do not specify the UserName, SessionName, **/id:**SessionID, ProgramName, or * parameters, query process displays only the processes belonging to the current user.

  • If a session is specified, it must identify an active session. You can use wildcards to identify the process.

  • Query process returns the following information:

    • The user who owns the process

    • The session that owns the process

    • The ID of the session

    • The name of the process

    • The state of the process

    • The ID of the process

  • When query process returns information, a less than (>) symbol is displayed before each process belonging to the current session.

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Command-line reference A-Z

Terminal Services commands