We’ve all been there, needing to create collections of computers by installed software in SCCM. Sometimes even needing to list computers that have two or more installed software on them.
So how do you create these collections? Read on below…
For this example, I am going to create a collection that will list all computers with “iTunes”. Then I will show you how to add multiple software.
- In “Assets and Compliance” go to your Device Collections and right-click and choose “Create Device Collection”.
- In the “Create Device Collection Wizard” enter a name for this new collection and you will want to limit the search to either “All Systems” or another collection of your choosing. I have about 3000 clients in the All Systems collection so I will choose another smaller collection for this example.
- In the next screen, click on “Add Rule” and then click on “Query Rule”.
- In the “Query Rule Properties”, enter a name for this query, “All computers with iTunes” and then click on “Edit Query Statement..”
- In the next window, you’ll want to click on “Show Query Language” and then copy/paste the below code and click on OK:
SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "iTunes%"
SMS_G_System_ADD_REMOVE_PROGRAMS.Version like "%" order by SMS_R_System.Name
- Once back in the “Query Rule Properties” window, click on OK to close and go back to the “Create Device Collection Wizard” where you can add more direct rules, query rules or include/ exclude collections. For now, click on Next.
- In the Summary step, click on Next.
- Once complete, click on Close.
- You will notice that the icon for your new collection is refreshing and that your member count will be “0”.
- Wait a few moments before right-clicking and selecting “Refresh” or press F5.
- All done!
To add additional software to the collection, you can add a separate query to the collection’s properties by modifying the line in the code which specifies the software to search for, but keep in mind this will result in an “OR” operation meaning it will list computers with either one or the other. If you want an “AND” operation then just modify the search criteria on the existing query:
- Right-click on the collection and click on Properties.
- In the ‘Membership Rules” tab click on Edit.
- You can update the query name in the “Query Rule Properties” window or just click on “Edit Query Statement…”
- Click on the “Criteria” tab and then select the toolbar button which looks like a yellow star.
- Choose the “Installed Applications” attribute class and the “Display Name” attribute and then click on OK.
- Change the operator to “is like” and then type the software title in the “Value” input box and make sure to include the wildcard “%” (not required if you want a specific title and are sure of the spelling).
- You will notice that the new software title has been added with an “AND” operator. You can also change the operator to an “OR” using the button second from last which reads “&|”. Click on OK.
- Back at the “Query Rules Properties” click on OK to close this window and then click on “Apply” or “OK” in the collection properties window to save the new changes.
- Again wait a few minutes before refreshing and it should update the collection membership as long as it finds the specified software on other computers.