Share via


Get-SCOMTaskResult

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Get-SCOMTaskResult

Gets the results for tasks that have run.

Syntax

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

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

Parameter Set: FromTask
Get-SCOMTaskResult [-Task] <ManagementPackTask> [-ComputerName <String> ] [-Credential <PSCredential> ] [-SCSession <Connection> ] [ <CommonParameters>]

Parameter Set: FromTaskResultBatchId
Get-SCOMTaskResult [-BatchID] <Guid> [-ComputerName <String> ] [-Credential <PSCredential> ] [-SCSession <Connection> ] [ <CommonParameters>]

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

Detailed Description

The Get-SCOMTaskResult cmdlet gets the results for tasks that have run.

Parameters

-BatchID<Guid>

Retrieves task results for a batch in which a task was run.

A Batch Id is a GUID that uniquely identifies the batch in which a task was run.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-ComputerName<String>

Specifies the name of a computer to establish a connection with. The computer must be running the System Center Data Access Service. The default value is the computer for the current management group connection. Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name. To specify the local computer, type the computer name, "localhost", or a dot (.).

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies a user account under which the management group connection will run. The default is the current user. Type a user name, such as "User01", "Domain01\User01", or "User@Domain.com", or enter a PSCredential object, such as one returned by the Get-Credential cmdlet. When you type a user name, you will be prompted for a password. For more information, type Get-Help Get-Credential.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Id<Guid>

Retrieves the task results with the specified Id.

An Id is a GUID that uniquely identifies an object on a local or remote computer. The GUID is unique, even when you have multiple sessions running in Windows PowerShell.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Instance<EnterpriseManagementObject>

Retrieves task results for one or more specified class instance objects. Enter a variable that represents the class instances, or type a command that gets the class instances. This parameter also accepts group objects.

For information about how to get a class instance object, type Get-Help Get-SCOMClassInstance.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-SCSession<Connection>

Specifies a connection to a management server. The default is the current management group connection. Specify a Management group connection object, such as one returned by the Get-SCOMManagementGroupConnection cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Task<ManagementPackTask>

Retrieves task results for one or more specified task objects. Enter a variable that represents the tasks, or type a command that gets the tasks.

For information about how to get a class instance object, type Get-Help Get-SCOMTask.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Examples

-------------------------- EXAMPLE 1 --------------------------

Description

-----------

This command gets all tasks with "SystemCenter" in their name, and then returns the task results for those tasks.
By using the ErrorAction parameter with a value of SilentlyContinue, tasks that do not have matching task results will not show an error.

PS C:\>Get-SCOMTask -Name *SystemCenter* | -Get-SCOMTaskResult -ErrorAction SilentlyContinue

-------------------------- EXAMPLE 2 --------------------------

Description

-----------

This command gets all class instances in the Contoso.com domain and then returns the task results for each class instance object.

By using the ErrorAction parameter with a value of SilentlyContinue, class instances that do not have matching task results will not show an error.

PS C:\>Get-SCOMClassInstance -displayname "*.Consoso.com" | Get-SCOMTaskResult -ErrorAction SilentlyContinue

-------------------------- EXAMPLE 3 --------------------------

Description

-----------

This command gets the task results with an Id of 7413b06b-a95b-4ae3-98f2-dac9ff76dabd.

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

-------------------------- EXAMPLE 4 --------------------------

Description

-----------

This command gets the task results with a BatchId of 2ef74789-f9f5-46b0-af70-16d01d4f4577.

PS C:\>Get-SCOMTaskResult -BatchId 2ef74789-f9f5-46b0-af70-16d01d4f4577

Get-SCOMClassInstance

Get-SCOMTask

Start-SCOMTask