SCOM Close alerts from rules

Was looking at a SCOM console with a lot of alerts today at a customer site. I did not feel like going through it all, so I wanted to clean out all alerts created by a rule, which had not been modified for at least 24 hours. This is because alerts coming from rules will not auto-close like the ones from monitors generally do.

So had to create a one-liner for it B)
This is for SCOM 2007.

get-alert -criteria ‘ResolutionState=”0” AND IsMonitorAlert=”False”’ |where {$_.LastModified -le (Get-Date).addhours(-24)} | resolve-alert -comment “Close old alerts generated by rules” | out-null

This will look for alerts with a New resolution state and coming from a rule, where the last modification to this alert was more than 24 hours ago, and close that alert with a small comment.

I have posted an extended script on Technet Gallery at http://gallery.technet.microsoft.com/SCOM-2007-R2-script-to-dae4ffda.

Sure cleaned out hundreds of old alerts :>

Allways comes in handy.
Bob Cornelissen

Comments are closed.