Tagged: Alerts

Re-notify users of a alerts

This little powershell-script will update all alerts with resolutionstate “New” and an age of at least 24 hours… and with that done the users subscribing to that alert will get a new notification.

$UpdateAlerts = Get-Alert | where { $_.ResolutionState -eq 0 -and $_.LastModified -lt (get-date).AddHours(-24) }

foreach ($alert in $UpdateAlerts) { $alert.Update("Renotify operators of an untouched alert open for 24 hours") }

PSOL: Resolve informational alerts without repeatcount

To get rid of a large number of alerts in SCOM you can of course use PowerShell…

This script will take informational alerts without any repeats that are 24 hours old and simply resolve them with a small comment.

get-alert | where { $_.Severity -eq 0 -and $_.RepeatCount -eq 0 -and $_.ResolutionState -eq '0' -and $_.LastModified -lt (get-date).AddHours(-24)} | Resolve-Alert -comment "Alert resovled via script (24 hours old informational alert without repeatcount)" | Format-Table MonitoringObjectPath, Name, TimeRaised

(Change “$_.RepeatCount -eq 0” to “$_.RepeatCount -lt 3” to get alerts with less then 3 repeats)