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:
- Create an attribute to trigger membership of the group
- Define a managed group based on the value of the attribute
- 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
If I was searching for a 32bit application on 32bit computer (or a 64bit application on a 64bit computer) then I could look in:
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:
- Go to the Authoring workspace
- Expand Management Pack Objects
- Select Attributes
- Click Create a New Attribute to open the Create Attribute Wizard
- 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
- Click Next
- On the Choose a Discover method page, select the following values:
- Discovery Type = Registry
- Target = Windows Computer
- For Management Pack, click New to create a new management pack (this will make managing the groups easier later).
- On the Create Management Pack page, type the following values:
- Name = My Software Groups
- Description = Definitions for computer groups based on installed software
- On the Knowledge page, click Create which will create the management pack and return you to the Create Attribute Wizard.
- Make sure the Management Pack drop down has My Software Groups selected and click Next
- 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
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 infrequently
- 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:
- Stay in the Authoring workspace
- Select the Groups node
- Click Create a New Group to start the Create Group Wizard
- Provide a Name and Description for the group:
- Name = Microsoft Office 2003 Web Component
- Description = Computers that have the Office 2003 Web Components installed
- Select My Software Groups as the value for Select destination management pack
- Click Next and then Click Next again to get to the Dynamic Members page
- Click Create/Edit rules… to open the Query Builder
- 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.
- Use the following values to build the query:
- In the Property column, select the attribute you created (Microsoft Office 2003 Web Component)
- In the Operator column, select Equals
- In the Value column, type True
- Click OK
- 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.
- Go to the Computers workspace
- Click Create a Computer Group
- Change the Criteria drop down to be Use a managed computer group
- Select the group created earlier (Microsoft Office 2003 Web Component) from the Managed computer groups drop down
- 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).