Get task list windows

Команда TASKLIST — отобразить список задач на локальном или удаленном компьютере.

Команда TASKLIST используется для получения списка процессов, выполняющихся на локальном или удаленном компьютере в данный момент времени.

Формат командной строки:

Примеры использования TASKLIST.

tasklist /? — выдать краткую справку по использованию команды.

tasklist — отобразить на экране консоли список процессов выполняющихся на локальном компьютере в данный момент времени. Пример отображаемой информации

Имя образа — имя исполняемого файла данного процесса. System Idle Process — это не имя образа, а индикация режима простоя, когда ни один из процессов не выполняется.

PID — уникальный идентификатор процесса. Присваивается процессу при его создании.

Имя сессии — имя сессии отображает признак Services — процесс запущен в качестве системной службы, Console — интерактивный пользовательский процесс, RDP-Tcp#n — процесс, созданный удаленным подключением по RDP ( клиентами служб терминалов) — .

№ сеанса — номер сеанса пользователя.

Память — объем используемой процессом памяти.

tasklist /FO LIST — то же, что и в предыдущем примере, но выводимые данные представлены в виде списка:

tasklist /FO CSV — отобразить список процессов в формате полей, разделяемых запятой:

tasklist /fo csv /nh — то же, что и в предыдущем примере, но строка заголовка с названием колонок не отображается ( 1-я строка ).

tasklist -S SERVER — отобразить список процессов выполняющихся на удаленном компьютере SERVER в данный момент времени.

tasklist /m wsock32.dll — отобразить список процессов, которые подгружают библиотеку wsock32.dll . Пример отображаемых результатов выполнения команды:

tasklist /m — если имя модуля не задано, то отображается весь список процессов, и по каждому процессу — весь список модулей. Пример результата выполнения команды:

tasklist /SVC — отобразить информацию о системных службах. Пример:

В колонке Службы отображается короткое имя службы, например, DcomLaunch — для Службы Терминалов

tasklist -s 192.168.0.1 -U mydomain\admin -P mypass /FI «memusage gt 10000» — отобразить список процессов, использующих более 10000кб ( 10 Мб) памяти на компьютере с IP-адресом 192.168.0.1 . При подключении к удаленному компьютеру используется имя пользователя admin в домене mydomain и пароль mypass

tasklist /fi «username ne NT AUTHORITY\Система» | more — отобразить список процессов, выполняющихся не от имени локальной системной учетной записи. Для некоторых версий Windows, вместо русского Система нужно использовать System . Команда объединена в цепочку с more для организации постраничного вывода на экран.

tasklist -s 192.168.0.110 -U mydomain\admin -P mypass /FI «sessionname eq RDP*» — отобразить список процессов на удаленном компьютере, созданных клиентами служб терминалов.

Кроме получения чисто справочной информации о выполняющихся в системе процессах, команда TASKLIST обычно используется как средство получения исходных данных для команды принудительного завершения процессов TASKKIll

tasklist

Displays a list of currently running processes on the local computer or on a remote computer. Tasklist replaces the tlist tool.

This command replaces the tlist tool.

Syntax

Parameters

Parameter Description
/s Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer.
/u \ Runs the command with the account permissions of the user who is specified by or by \ . The /u parameter can be specified only if /s is also specified. The default is the permissions of the user who is currently logged on to the computer that is issuing the command.
/p

Specifies the password of the user account that is specified in the /u parameter. /m Lists all tasks with DLL modules loaded that match the given pattern name. If the module name is not specified, this option displays all modules loaded by each task. svc Lists all the service information for each process without truncation. Valid when the /fo parameter is set to table. /v Displays verbose task information in the output. For complete verbose output without truncation, use /v and /svc together. /fo

Specifies the format to use for the output. Valid values are table, list, and csv. The default format for output is table. /nh Suppresses column headers in the output. Valid when the /fo parameter is set to table or csv. /fi Specifies the types of processes to include in or exclude from the query. You can use more than one filter or use the wildcard character ( \ ) to specify all tasks or image names. The valid filters are listed in the Filter names, operators, and values section of this article. /? Displays help at the command prompt.

Filter names, operators, and values

Filter Name Valid Operators Valid Value(s)
STATUS eq, ne RUNNING | NOT RESPONDING | UNKNOWN . This filter isn’t supported if you specify a remote system.
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number
SESSIONNAME eq, ne Session name
CPUtime eq, ne, gt, lt, ge, le CPU time in the format HH:MM:SS, where MM and SS are between 0 and 59 and HH is any unsigned number
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne Any valid user name ( or )
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title. This filter isn’t supported if you specify a remote system.
MODULES eq, ne DLL name

Examples

To list all tasks with a process ID greater than 1000, and display them in csv format, type:

To list the system processes that are currently running, type:

To list detailed information for all processes that are currently running, type:

To list all the service information for processes on the remote computer srvmain, which has a DLL name beginning with ntdll, type:

To list the processes on the remote computer srvmain, using the credentials of your currently logged-on user account, type:

To list the processes on the remote computer srvmain, using the credentials of the user account Hiropln, type:

Get Task List

Gets the values of the properties for all of the tasks in the specified job.

Request

You can specify the Get Task List request as follows.

Method Request URI
GET (before HPC Pack 2016) https://head_node_name:port/WindowsHPC/HPC_cluster_name/Job/job_identifier/Tasks
GET (HPC Pack 2016) https://head_node_name:port/WindowsHPC/Job/job_identifier/Tasks

For instances of the REST web service that are hosted in Azure, the head node name should have a format of Windows_Azure_service_name.cloudapp.net.

To get the name to use for an HPC cluster that runs at least Microsoft HPC Pack 2008 R2 with Service Pack 3 (SP3), use the Get Clusters operation.

URI Parameters

You can specify the following additional parameters on the request URI.

Optional. A comma-separated list of the names for the properties of the tasks for which you want to get values.

If you do not specify the Properties parameter, the response contains values for the TaskId, Name, State, CommandLine, ExitCode, ParentJobId, JobTaskId, and InstanceId properties. For a list of the properties that you can specify, see the Remarks section.

If a property with a specified name does not exist for a task, an error occurs.

Optional. Specifies whether to get properties only for the master task for a parametric sweep task, or for all of the subtasks instead. True indicates that you want to get properties for all of the subtasks. False indicates that you want to get properties only for the master task. The default value is True.

Specifies internal data from the x-ms-continuation-QueryId header from the response in the previous Get Task List operation in a continuation sequence of Get Task List operations. For more information, see the Response Headers section later in this topic.

Specifies internal data from the x-ms-continuation-CurrentObjectNumber header from the response in the previous Get Task List operation in a set of Get Task List operations. For more information, see the Response Headers section later in this topic. Deprecated starting with Microsoft HPC Pack 2008 R2 with Service Pack 3 (SP3).

Optional. Specifies the version of the operation to use for this request. To specify MicrosoftВ HPCВ PackВ 2008В R2 with ServiceВ PackВ 3 (SP3), use a value of 2011-11-01. The minimum version that supports this URI parameter is MicrosoftВ HPCВ PackВ 2008В R2 with SP3.

The value of this URI parameter is ignored if the request also contains the api-version header.

Optional. Specifies OData filters to use for this request in the following format «$filter= %20and%20 …».

To filter the tasks by a valid task state, use the filter «TaskState%20eq%20 «. To retrieve tasks whose state changed after a certain date and time, use the filter «ChangeTimeFrom%20eq%20 «.

A null value is ignored.

The minimum version that supports this URI parameter is Microsoft HPC Pack 2012. To use this parameter, also specify the Render URI parameter set to RestPropRender and a minimum api-version value of 2012-11-01.

Example: «$filter=TaskState%20eq%20queued%20and%20 ChangeTimeFrom%20eq%202015-10-16&Render=RestPropRender&api-version=2012-11-01». For information about task states, see TaskState.

Parameter Description
Properties
Render Required if the $filter URI parameter is specified. Set the value to RestPropRender to specify that the response body is formatted in XML compatible with MicrosoftВ HPCВ PackВ 2008В R2 with ServiceВ PackВ 2 (SP2). The minimum version that supports this URI parameter is MicrosoftВ HPCВ PackВ 2012.
SortTasksBy Optional. A task property by which tasks will be sorted. If this parameter is not specified or a property with a specified name does not exist for a task, the result will be sorted by task Id.
RowsPerRead Optional. Specifies how many lines of data to retrieve each time. The default is set to 10. At least one record will be retrieved.

Request Headers

The following table describes required and optional request headers.

Optional. Specifies the version of the operation to use for this request. To specify MicrosoftВ HPCВ PackВ 2008В R2 with SP3, use a value of 2011-11-01. The minimum version that supports this header is MicrosoftВ HPCВ PackВ 2008В R2 with SP3.

The value specified in this header overrides the value specified in the api-version URI parameter if both are specified.

Optional. Specifies the version of the operation to use for this request.

Deprecated beginning with Microsoft HPC Pack 2008 R2 with Service Pack 3 (SP3).

Request Body

Response

The response includes an HTTP status code, a set of response headers, and a response body in XML format.

Status Code

A successful operation returns status code 200 (OK). For more information about status codes, see HttpStatusCode.

The error response is dependent upon the api-version used in the request. If the api-version is not provided, or CCP_Version is specified, then the error response will be an XML string (Note: The error message will vary based on the error):

If the api-version is 2011-11-01 or later, the error message will be a more descriptive XML response (Note: Values will vary based on the error):

Response Headers

The response for this operation includes the following headers.

Request Header Description
api-version

A comma-separated list of RFC 1918 IP addresses that indicate the sequence of instances of the REST web service that the operation called in order from to right.

Only responses from instances of the REST web service that are hosted on Azure contain this header. Responses from instances of the REST web service that are hosted on premise omit this header.

This header is supported beginning with Microsoft HPC Pack 2008 R2 with SP3 and is not available in previous versions.

Enables large sets of data to be returned in smaller responses across a continuation sequence of several requests. The value of this header is to be assigned to the queryId query string parameter in the next call in the sequence of calls to the Get Task List operation. The response to the Get Task List operation contains this header as long as additional data remains to be processed. You use the values of this header for one operation in the queryId URI parameter for the next operation.

The format of the data in this header is not guaranteed to remain unchanged. You should only copy the data in this header from one operation in a set of multiple operations to the queryId URI parameter for the next operation. You should not use the data in this header or depend on the format of the data in this header in any other way.

For an example of how to use this header and URI parameter in a way that potential changes will not impact, see the code for the sample client applications for REST API. For information about how to get these sample client applications, see Getting Sample Programs that use the REST API.

Contains internal data that support working with sets of data that are too large or too expensive to get in a single response body by dividing the Get Task List operation into a set of multiple Get Task List operations. The response to the Get Task List operation contains this header as long as additional data remains to be processed. You use the values of this header for one operation in the CurrentObjectNumber URI parameter for the next operation.

The format of the data in this header is not guaranteed to remain unchanged. You should only copy the data in this header from one operation in a set of multiple operations to the CurrentObjectNumber URI parameter for the next operation. You should not use the data in this header or depend on the format of the data in this header in any other way.

For an example of how to use this header and URI parameter in a way that potential changes will not impact, see the code for the sample client applications for REST API.

Deprecated starting with Microsoft HPC Pack 2008 R2 with SP3.

The response for this operation also includes standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Body

The format of the response body is as follows.

The following table describes each of the elements in the response XML.

Response Header Description
x-ms-hpc-authoritychain
x-ms-continuation-CurrentObjectNumber

Represents the set of tasks in the specified job.

Represents a single task.

Represents the set of properties for the task.

Represents a single property for the task.

Contains the name of the property.

Contains the value of the property.

Remarks

The following table shows the task properties for which you can get the values or by which you can sort results. For information about the property, including the versions of Microsoft HPC Pack that support it, see the corresponding property of the ISchedulerTask or ITaskId interface in the managed API for Microsoft HPC Pack.

Element Description
ArrayOfObject
Property Corresponding ISchedulerTask or ITaskId Property
TaskId ISchedulerTask.TaskId
Name ISchedulerTask.Name
State ISchedulerTask.State
PreviousState ISchedulerTask.PreviousState
MinCores ISchedulerTask.MinimumNumberOfCores
MaxCores ISchedulerTask.MaximumNumberOfCores
MinNodes ISchedulerTask.MinimumNumberOfNodes
MaxNodes ISchedulerTask.MaximumNumberOfNodes
MinSockets ISchedulerTask.MinimumNumberOfSockets
MaxSockets ISchedulerTask.MaximumNumberOfSockets
RuntimeSeconds ISchedulerTask.Runtime
SubmitTime ISchedulerTask.SubmitTime
CreateTime ISchedulerTask.CreateTime
EndTime ISchedulerTask.EndTime
ChangeTime ISchedulerTask.ChangeTime
StartTime ISchedulerTask.StartTime
ParentJobId ISchedulerTask.ParentJobId
CommandLine ISchedulerTask.CommandLine
WorkDirectory ISchedulerTask.WorkDirectory
RequiredNodes ISchedulerTask.RequiredNodes
DependsOn ISchedulerTask.DependsOn
IsExclusive ISchedulerTask.IsExclusive
IsRerunnable ISchedulerTask.IsRerunnable
StdOutFilePath ISchedulerTask.StdOutFilePath
StdInFilePath ISchedulerTask.StdInFilePath
StdErrFilePath ISchedulerTask.StdErrFilePath
ExitCode ISchedulerTask.ExitCode
RequeueCount ISchedulerTask.RequeueCount
StartValue ISchedulerTask.StartValue
EndValue ISchedulerTask.EndValue
IncrementValue ISchedulerTask.IncrementValue
ErrorMessage ISchedulerTask.ErrorMessage
Output ISchedulerTask.Output
UserBlob ISchedulerTask.UserBlob
Type ISchedulerTask.Type
IsServiceConcluded ISchedulerTask.IsServiceConcluded
FailJobOnFailure ISchedulerTask.FailJobOnFailure
FailJobOnFailureCount ISchedulerTask.FailJobOnFailureCount
AllocatedCoreIds ISchedulerTask.AllocatedCoreIds
AllocatedNodes ISchedulerTask.AllocatedNodes
HasRuntime ISchedulerTask.HasRuntime
JobTaskId ITaskId.JobTaskId
InstanceId ITaskId.InstanceId
TaskValidExitCodes ISchedulerTask.ValidExitCodes

Requirements

HPC Pack 2008 R2 with at least SP2, or a later version of HPC Pack.

Читайте также:  Windows games on mac download
Оцените статью