Share via


SCOM Dynamic Group Membership – Class Objects from Computers that are member in another Group

Dears,

I received the following request from my customer.

Customer wants to get all SQL DB Engines for Computers that are member of another SCOM Group. he wants to control the computers group without the headache of aligning group members manually. The new group will be used for custom user roles and notifications.

In order to accomplish this, I did many searches on the internet and found a great article from Marthijn van Rheenen that helped me a lot.

In the following scenario we will create 2 Groups (1 Selected windows computers and the other for SQL DB Engines hosted in group 1)

Group 1: System Center Servers

Group 2: System Center Servers - SQL DB Engines

Let's Roll


Follow the below procedure:

1- Create new group "System Center Servers" (Explicit Members) and add selected Windows Computer in it.

2- Create a new group "System Center Servers - SQL DB Engines" (Dynamic Membership) and use Query Builder to add all SQL DB Engine class

3- In order to add an expression for "System Center Servers - SQL DB Engines" group, we will export the management pack and get the group ID for "System Center Servers" and "System Center Servers - SQL DB Engines". this can be found at the end of the XML

System Center Servers (UINameSpace236da4811f214e6bba9bd6a110bd8994.Group)

System Center Servers - SQL DB Engines (UINameSpace109b6c2fdbcc4b85a11d7b6f10a8ec93.Group)

4- Locate the discovery rule for "System Center Servers - SQL DB Engines" Group within the XML

5- The following expression should be added after </RelationshipClass> and before </MembershipRule> where the MPElement name should target the "System Center Servers" Group

<Expression>
<Contained>
<MonitoringClass>$MPElement[Name="UINameSpace236da4811f214e6bba9bd6a110bd8994.Group"]$</MonitoringClass>
</Contained>
</Expression>

NOTE: some times the copy-paste rewrite the quotations. Make sure the quotations are fixed otherwise MP Import will fail.

6- Import updated MP

7- Enjoy :)

-----------------------------------------------------------------------------------

Another Scenario I tested for IIS Websites, the below snapshots shows you the two groups when SharePoint Server is added to the System Center Servers Group and after removing it from the group.

BEFORE: SharePoint Server is member of System Center Servers Group

AFTER: SharePoint Server removed from System Center Servers Group

Thanks for reading and hope you get benefit out of it :)

*** This is provided "AS IS" with no warranties, make sure you test in test environment"

Comments

  • Anonymous
    May 18, 2016
    hi i have an issue .. SCOM default group windows computer server group is showing window 7 inside it . why this happens and how to stop it . thanks