Friday, January 13, 2012

[Powershell] Get classes information for all MP in SCOM

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

  1. get-monitoringclass | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}}, @{Name="MP Version";Expression={ foreach-object {$_.GetManagementPack().Version }}}, Name, DisplayName, Id, Abstract, Accessibility, Base, Comment, Description, Hosted, LanguageCode, LastModified, ManagementGroup, ManagementGroupId, PropertyCollection, Singleton, Status, TimeAdded, XmlTag  |  sort-object -property MP | export-csv "C:\AllClasses-MyMgtGroupName.csv"

In my case this is usefull to determine what are the Name + ID for all classes for a specific MP to configure monitoring instructions in a tool.

With the same way you can export Rules and Monitors information for all your MP : http://tetris38.blogspot.com/2012/01/powershell-get-rules-information-or.html

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

No comments:

Post a Comment