Command Shell Examples
Useful SQL Queries
Find collection rule for specific Event Id - Jonathan Almquist on Operations Manager - Site Home - TechNet Blogs

Find collection rule for specific Event Id

Find collection rule for specific Event Id

  • Comments 5
  • Likes

Beware of word wrap.

foreach ($rule in get-rule | where {$_.category -eq "EventCollection"} | foreach-object {$_.DataSourceCollection})
    {
    if ($rule.get_configuration().ToString() -match "event number")
        {$rule.get_ParentElement().DisplayName}
    }

main menu

I do not moderate this blog anymore. If you have a question regarding this post, send me a message.

Comments
  • This doesn't seem to work with event id's that are identified with regular expressions, hopefully we can find a fix.

  • PingBack from http://blogs.technet.com/jonathanalmquist/archive/2008/11/17/operations-manager-2007-command-shell.aspx

  • Yes, Blake - this is kind of a hack job.  If we handled XML with the correct method, we could pass in regex.

  • LOL - just approved some old comments and saw this was over 3 years ago.  Sorry for the delay :)

  • Works great, but... :)

    would be great to add the event source to minimize the number of results...

    thanks Jonathan