Get-SCOMTask

Get-SCOMTask

Gets a list of tasks.

構文

Parameter Set: Empty
Get-SCOMTask [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromInstance
Get-SCOMTask [-Instance] <EnterpriseManagementObject[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromManagementPack
Get-SCOMTask [-ManagementPack] <ManagementPack[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromManagementPackClass
Get-SCOMTask [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [-Target <ManagementPackClass[]> ] [ <CommonParameters>]

Parameter Set: FromTaskDisplayName
Get-SCOMTask [-DisplayName] <String[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromTaskId
Get-SCOMTask -Id <Guid[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromTaskName
Get-SCOMTask [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-Name <String[]> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

詳細説明

The Get-SCOMTask cmdlet gets a list of tasks. Use this cmdlet to get tasks that have a specific name or ID as well as tasks that are associated with specified user roles, class instances, management packs, or target classes.

パラメーター

-ComputerName<String[]>

Specifies an array of names of computers. The cmdlet establishes temporary connections with management groups for these computers. You can use NetBIOS names, IP addresses, or fully qualified domain names (FQDNs). To specify the local computer, type the computer name, localhost, or a dot (.).

The computer must run the System Center Data Access service.

If you do not specify this parameter, the default is the computer for the current management group connection.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Credential<PSCredential>

Specifies the user account under which the management group connection runs. Specify a PSCredential object, such as one that the Get-Credential cmdlet returns, for this parameter. For more information about credential objects, type "Get-Help Get-Credential".

This account must have access to the server that is specified in the ComputerName parameter if that parameter appears.

If you do not specify this parameter, the default is the account for the current user.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-DisplayName<String[]>

Specifies an array of display names for task objects. This parameter takes one or more strings, and the cmdlet looks for matches among the display names of the task objects that the cmdlet works with. Values for this parameter vary depending on which localized management packs are imported into the management group and the locale of the user that runs Windows PowerShell.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

true

-Id<Guid[]>

Specifies an array of task IDs. The cmdlet gets the tasks that have these IDs. To obtain a task, use the Get-SCOMTask cmdlet. The ID is the ID property of a task object.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Instance<EnterpriseManagementObject[]>

Specifies an array of EnterpriseManagementObject objects that represent class instances. The cmdlet retrieves tasks for the class instances that the array stores. Specify a variable that represents the class instances or use a cmdlet such as Get-SCOMClassInstance that gets the class instances. This parameter also accepts group objects. To obtain a group object, use the Get-SCOMGroup cmdlet.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-ManagementPack<ManagementPack[]>

Specifies an array of management pack objects. The cmdlet gets tasks for the management pack objects in the array. Specify a variable that contains management pack objects, or use a cmdlet such as Get-SCOMManagementPack that gets management pack objects.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Name<String[]>

Specifies an array of task names.

The cmdlet takes each string in the array and matches it with the Name properties of the task objects that this cmdlet works with.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

true

-SCSession<Connection[]>

Specifies an array of Connection objects. To get Connection objects, specify the Get-SCOMManagementGroupConnection cmdlet.

If this parameter does not appear, the cmdlet uses the active persistent connection to a management group. Use the SCSession parameter to specify a different persistent connection. You can create a temporary connection to a management group by using the ComputerName and Credential parameters. For more information, type "Get-Help about_OpsMgr_Connections".

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

-Target<ManagementPackClass[]>

Specifies an array of management pack class objects that represent target classes. Specify a variable that contains the target class objects, or use a cmdlet such as Get-SCOMClass that gets the target class objects.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

true (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Get tasks by specifying a partial name

This command gets all tasks that have health in their names.

PS C:\> Get-SCOMTask -Name "*health*"

Example 2: Get a task by using a partial display name

This command gets all tasks that have display names that begin with Stop.

PS C:\> Get-SCOMTask -DisplayName "Stop*"

Example 3: Get a task by specifying a partial display name and an error action

This command gets all tasks for the management packs that have System Center Core in their display names. The command uses the Get-SCOMManagementPack cmdlet to get management packs based on display names, and passes them to the to the Get-SCOMTask cmdlet. Because the command specifies SilentlyContinue for the ErrorAction parameter, if the cmdlet finds a management pack with no associated tasks, it continues to run and does not display error messages.

PS C:\> Get-SCOMManagementPack -DisplayName "System Center Core*" | Get-SCOMTask -ErrorAction SilentlyContinue

Example 4: Get tasks by using a partial class name

This command gets all tasks for classes that have health in their names.

PS C:\> Get-SCOMClass -Name "*health*" | Get-SCOMTask

Example 5: Get tasks by specifying a partial class instance name

This command gets all tasks for class instances that have .Contoso.com in their names.

PS C:\> Get-SCOMClassInstance -Name "*.Contoso.com" | Get-SCOMTask

Example 6: Get a task by specifying an ID

This command gets the task that has an ID of 7413b06b-a95b-4ae3-98f2-dac9ff76dabd.

PS C:\> Get-SCOMTask -Id 7413b06b-a95b-4ae3-98f2-dac9ff76dabd

関連トピック

Get-SCOMClass

Get-SCOMClassInstance

Get-SCOMManagementPack

Get-SCOMManagementGroupConnection

Get-SCOMTaskResult

Start-SCOMTask