Get-TaskResult
Get-TaskResult
Gets monitoring task results.
Syntax
Parameter Set: FromCriteria
Get-TaskResult [[-Criteria] <String> ] [[-Path] <String[]> ] [ <CommonParameters>]
Parameter Set: FromBatchId
Get-TaskResult [-BatchId] <Guid> [[-Path] <String[]> ] [ <CommonParameters>]
Parameter Set: FromId
Get-TaskResult [-Id] <Guid> [[-Path] <String[]> ] [ <CommonParameters>]
Detailed Description
Gets monitoring task results.
Parameters
-BatchId<Guid>
Specifies the batch ID of the tasks for which to retrieve results.
Aliases |
none |
Required? |
true |
Position? |
2 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Criteria<String>
Specifies criteria using syntax designed for use with System Center Operations Manager. Only rules that meet the specified criteria will be retrieved. To learn about the syntax, consult the SDK topic, "Criteria Expression Syntax", in the System Center Operations Manager 2007 SDK. You can find the SDK by search Microsoft Developer Network (MSDN) online at https://msdn.microsoft.com.
Aliases |
none |
Required? |
false |
Position? |
3 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Id<Guid>
Specifies the GUID of the task result to retrieve.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByValue) |
Accept Wildcard Characters? |
false |
-Path<String[]>
Specifies paths of management group connections. Task results are returned for tasks run in these management groups. To enter multiple values, separate them by using commas.
Aliases |
none |
Required? |
false |
Position? |
4 |
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
Notes
- For more information, type "Get-Help Get-TaskResult -detailed". For technical information, type "Get-Help Get-TaskResult -full".
When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".
Examples
-------------- EXAMPLE 1 --------------
This command uses Get-TaskResult to return all task results. It then uses Select-Object to select and display the TimeStarted, TimeFinished and Status properties. It also uses advanced Select-Object syntax to define an additional property named Display Name. The value of that property is determined by the result of the call to Get-Task which appears as part of the first parameter to Select-Object.
C:\PS>get-taskresult -path monitoring:\ |
select-object @{name="Display Name";`
expression={foreach-object `
{(get-task -id $_.monitoringtaskid).displayname}}},`
timestarted,timefinished,status