[This blog post was resurrected from cache from my original T2R2 blog (cameronfuller.spaces.live.com) as it still has value but is no longer available on the Internet outside of searching through older cache sites. The images have been lost unfortunately but the text was still available online.]
For starters, unless you will be creating a very large number of Custom Computer Groups in Operations Manager it will be more efficient to do this through the console. Also, This is my first deep dig into XML so hopefully the approach that I’m taking here isn’t too far off of the mainstream. However, if you want a good example for how to dig into XML and see what it impacts or if you need to create a large number of groups this may be a viable option. The following were the steps taken:
- Created a management pack (Operations Console, Administration, Management Packs, right-click and Create new Management Pack) with an easy to identify name. In this example “Odyssey”.
- Created a custom group and put it in the management pack.
- Exported the new management pack to xml (Operations Console, Administration, Management Packs, find the management pack on the right hand side, right-click on it and choose Export Management Pack)
- An XML editor does make this much easier, the following one was recommended by Joseph Fluckiger and works like a champ: http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628&displaylang=en.
- Also use internet explorer and allow blocked content so that sections of the XML document can be closed out and viewed more easily.
To update an existing Management Pack export to include multiple computer groups we copy a class type, a discovery, and DisplayStrings within the XML file. Each is then updated to have a unique ID and customized to the requirements of the new Computer Group being created.
Repeat these steps for each Computer Group that needs to be created.
- Copy and paste the current ClassType (ManagementPack / TypeDefinitions / EntityTypes / ClassTypes).
- Change the ID (ClassType / ID) to a unique ID. In this example we changed the last digit from an E to a G.
- Copy and paste the current Discovery (ManagementPack / Monitoring / Discoveries).
- Change the #text for the new group to the new value for the group (Management Pack / Monitoring / Discoveries / Discovery / DataSource / Membership Rules / Membership Rule / Expression / SimpleExpression / Value Expression / Value / #text).
- Change the ID (ManagementPack / Monitoring / Discoveries / Discovery / ID) and Target fields (ManagementPack / Monitoring / Discoveries / Discovery / Target).
- Copy and paste the current DisplayStrings (ManagementPack / LanguagePacks / LanguagePack / DisplayStrings / DisplayString). There are TWO of these which exist, one for the Group, one for the discovery.
- Change the ElementID (ManagementPack / LanguagePacks / LanguagePack / DisplayStrings / DisplayString). In this example we changed the last digit from an E to a G.
- Change the Name for the new group to the new name for the group (ManagementPack / LanguagePacks / LanguagePack / DisplayStrings / DisplayString / Name / #text). In this example we made the name unique by adding the number 2 to the end of it.
- Change the Description for the new group to the new name for the group (ManagementPack / LanguagePacks / LanguagePack / DisplayStrings / DisplayString / Description / #text). The description field only exists for the second DisplayStrings section that is copied.
- Import the management pack into OpsMgr. You will need to import it using the same XML file name that it was exported with. Errors at this point on the import are related to updates which were made in the XML document.
- Validate the existence of the new computer groups in OpsMgr through using the scope option and choosing the new Computer Group name from the list.