The comment stripped out the escape characters on me. For the modified Get-SCOMAlert, the syntax surrounding the $AlertId variable is surrounded by escaped single quotes.
Backtick Single Quote $AlertID Backtick Single Quote
I hope that is clear enough.
So in addition to changes listed by Erik:
LastModifiedBy clause to be “Does not match pattern” entering ^(System|Auto-resolve|DOMAINOrchestratoruser)$
Adding an Update Alert step (in mine I added a custom field instead to stop the looping)
I also recommend changing the line in the script from this:
$alerts = Get-SCOMAlert | whe…[Read more]