Friday, January 13, 2012

[Powershell] Get Rules information or Monitors information for all MP in SCOM

Here is a short powershell command to list in a .CSV file Rules information for all SCOM MP using a powershell script :

Get Rules Informations :
  1. get-rule | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}}, @{Name="MP Version";Expression={ foreach-object {$_.GetManagementPack().Version }}}, Name, DisplayName, XmlTag, Enabled, Category |
    sort-object -property MP | export-csv "C:\Allrules-MyMgtGroupName.csv"
Get Monitors Informations :
  1. get-monitor | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}}, @{Name="MP Version";Expression={ foreach-object {$_.GetManagementPack().Version }}}, Name, DisplayName, XmlTag, Enabled, Category, Configuration  | Sort-object -property MP | export-csv "C:\AllMonitors-MyMgtGroupName.csv"
 With the same way, you can imagine listing all classes for all MP : see http://tetris38.blogspot.com/2012/01/powershell-get-classes-information-for.html

This posting is provided "AS IS" with no warranties.

No comments:

Post a Comment