Your company's ad could live here and reach over 50,000 people a month!

Share This Post

OpsMgr PowerShell: Close all open alerts generated by a rule

By request I came up with the following PowerShell one liner to close all open alerts that were generated by a Rule. Reason being that if one closes an alert generated by a monitor, that alert will not be fired off again until the computers health is recalculated. To find alerts that are generated by a rule I use the IsMonitorAlert property from the get-alert commandlet. IsMonitorAlert is either True or False. If the property IsMonitorAlert = True then the alert was generated by a monitor. If the property IsMonitorAlert = False then the alert was generated by a rule.

get-alert -criteria ‘ResolutionState = ”0” AND IsMonitorAlert = ”False”’| resolve-alert -comment "Closing rule generated alerts" | out-null

Share This Post

Leave a Reply