Get-SCOMAlertHistory
Get-SCOMAlertHistory
Gets history entries for alerts.
Syntax
Parameter Set: FromAlertDefault
Get-SCOMAlertHistory [-Alert] <MonitoringAlert[]> [ <CommonParameters>]
Detailed Description
The Get-SCOMAlertHistory cmdlet gets history entries for one or many alerts.
Parameters
-Alert<MonitoringAlert[]>
Specifies an array of MonitoringAlert objects. To obtain a MonitoringAlert object, use the Get-SCOMAlert cmdlet.
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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1: Get the history of alerts
This command gets all alerts with heartbeat in their name and passes the alerts to the Get-SCOMAlertHistory cmdlet by using the pipe operator. The Get-SCOMAlertHistory cmdlet returns the history for each alert. The Format-Table cmdlet displays the values for the ResolutionState, Owner, ModifiedBy, and Comments properties for each alert.
PS C:\> Get-SCOMAlert -Name "*heartbeat*" | Get-SCOMAlertHistory | Format-Table, ResolutionState, Owner, ModifiedBy, Comments