Resolving all SCOM alerts
This example demonstrates how an SCOM administrator can resolve all the alerts that are older than five days. We can use the same example code to resolve all the alerts that are older than our custom required date by changing the value from 5
to our custom requirement as shown in the following example:
$targetDate = (Get-Date).AddDays(-5) $allAlerts = Get-SCOMAlert $filterAlerts = $allAlerts | Where-Object {($_.ResolutionState -eq 0) -and ($_.LastModified -lt $targetDate) -and ($_.IsMonitorAlert -eq $false)} $filterAlerts | Resolve-SCOMAlert