Creating a Dynamic Group Based on Installed Software

At the Dynamics Convergence 2010 conference I mentioned to several people that it is possible to create a dynamic group based on whether a piece of software is installed or not but I never went into the details of how to do it. This posting describes how to create a group for a particular piece of installed software (Microsoft Office 2003 Web Component for the purpose of illustrating the process).

Creating a group based on if software is installed is helpful for approving new versions of software for installation (e.g. you want to upgrade from version 2 to version 3),

There is a three step process to create a dynamic group based on if a software application is installed:

  1. Create an attribute to trigger membership of the group
  2. Define a managed group based on the value of the attribute
  3. Create a Computer group linked to the managed group

Create an Attribute

The first step is to create an attribute that we can use to evaluate whether a computer has a piece of software installed or not. This can be based on either a registry key or WMI query. If you have a choice between using a registry key or a WMI query, opt for a registry key – the lookup process is more efficient.

You can use any registry key or WMI query. For this blog, since I am looking for a 32bit application installed on a 64bit computer, I’m going to use a registry entry under

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\

If I was searching for a 32bit application on 32bit computer (or a 64bit application on a 64bit computer) then I could look in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\

I’m using the above registry key location since it tends to be a reliable way to determine which software is installed. In the above registry locations will be any currently installed software that has an uninstall program or feature.

To create an attribute:

  1. Go to the Authoring workspace
  2. Expand Management Pack Objects
  3. Select Attributes
  4. Click Create a New Attribute to open the Create Attribute Wizard
  5. Provide a name and a description for the attribute
    • Name = Microsoft Office 2003 Web Component
    • Description = Check if the Office 2003 Web Components are installed on this computer
  6. Click Next 
  7. On the Choose a Discover method page, select the following values:
    1. Discovery Type = Registry
    2. Target = Windows Computer
  8. For Management Pack, click New to create a new management pack (this will make managing the groups easier later).
  9. On the Create Management Pack page, type the following values:
    • Name = My Software Groups
    • Description = Definitions for computer groups based on installed software
  10. On the Knowledge page, click Create which will create the management pack and return you to the Create Attribute Wizard.
  11. Make sure the Management Pack drop down has My Software Groups selected and click Next image
  12. On the Registry Probe Configuration screen:
    • Leave Key selected in the Key or Value radio button
    • In the Path field type the registry key you are looking for. In this example, the registry key has a GUID, but when I look at the DisplayName property in the registry I can see this GUID is for Microsoft Office 2003 Web Components
      Path = SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90120000-00A4-0409-0000-0000000FF1CE}\
      If you use the Copy Key Name feature in regedit to copy in the path, remember to delete the HKEY_LOCAL_MACHINE\ part at the start since the wizard automatically provides this value.
    • Keep the Attribute Type as Check if exists
    • Increase the Frequency to 43,200 seconds (12 hours) since this attribute will only change infrequentlyimage
  13. Click Finish to create the attribute

We have now created an attribute, whose value will be collected every 12 hours from each Windows Computer managed by Essentials.

Define a Managed Group

Now that we have an attribute, we can use the attribute to define a group whose membership will change based on whether the value of the attribute is true (i.e. Office 2003 Web Components are installed).

To create the Managed Group:

  1. Stay in the Authoring workspace
  2. Select the Groups node
  3. Click Create a New Group to start the Create Group Wizard
  4. Provide a Name and Description for the group:
    • Name = Microsoft Office 2003 Web Component
    • Description = Computers that have the Office 2003 Web Components installed
  5. Select My Software Groups as the value for Select destination management pack image
  6. Click Next and then Click Next again to get to the Dynamic Members page
  7. Click Create/Edit rules…  to open the Query Builder
  8. Change the desired class to be Windows Computer_Extended and Click the Add button
    If you don’t see this as an option, go back to step 5 and make sure the Management Pack you created the attribute in is selected.
  9. Use the following values to build the query:
  10. In the Property column, select the attribute you created (Microsoft Office 2003 Web Component)
  11. In the Operator column, select Equals
  12. In the Value column, type True image
  13. Click OK
  14. Click Next. Click Next. Click Create.

We have now created a group whose membership is controlled by the value of the attribute defined earlier. In our case, we now have a group for all computers with the Microsoft Office 2003 Web Component installed.

Create a Computer Group Linked to the Managed Group

Managed groups do not show in the Computers workspace by default. Our final step is to add the group we created in the previous step into the Computers workspace, where it will then be available for approving software and updates.

  1. Go to the Computers workspace
  2. Click Create a Computer Group
  3. Change the Criteria drop down to be Use a managed computer group
  4. Select the group created earlier (Microsoft Office 2003 Web Component) from the Managed computer groups drop down
  5. Click Create

You now have a computer group whose membership will change depending on the software installed on the computers managed by Essentials.

A Final Word

By saving the attributes and group definitions in their own management pack you can export and share your software groups with other people. You can also export the management pack and manually edit it (its XML) if you want to create multiple groups without stepping through the wizards.

Before you create lots and lots of groups, it is important to know that we’ve tested Essentials 2010 to be able to handle up to 100 computer groups. While the process above will also work with Essentials 2007, we are aware of scale issues that can cause group synchronization to stop working in Essentials 2007 when there are around 30 groups (for some people the number is higher, for others it is lower).