Estimated reading time: 2 minutes
To automate the process of identifying all systems with WinRAR installed, you can create a custom collection in SCCM using a WQL (WMI Query Language) query. This will allow SCCM to dynamically populate the collection with any machines that have WinRAR installed, making it easier to manage and deploy your uninstall script.
WQL Collection Query
Here’s a sample WQL query that you can use to create a collection for all WinRAR installations:
select
SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
from SMS_R_System
inner join SMS_G_System_ADD_REMOVE_PROGRAMS on
SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceID
where
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "WinRAR%"
Steps to Create the Collection in SCCM
- Open the SCCM Console: Navigate to the SCCM console on your server.
- Create a New Collection:
- Go to Assets and Compliance > Device Collections.
- Right-click Device Collections and select Create Device Collection.
- Name your collection, for example, “WinRAR Installations.”
- Specify Membership Rules:
- In the Membership Rules section, click Add Rule > Query Rule.
- Name the query, e.g., “WinRAR Query.”
- Click Edit Query Statement.
- In the Query Statement Properties window, switch to the Criteria tab.
- Click Show Query Language and paste the WQL query provided above.
- Finish the Wizard: Complete the wizard to create the collection.
Once set up, this collection will automatically include all devices where WinRAR is installed. You can then deploy the uninstall programme to this collection to ensure that WinRAR is removed from any device within it.
FAQ
Can I modify the WQL query to target different software?
Yes, you can modify the DisplayName
value in the WQL query to target any software installed on your devices.
What happens if WinRAR is reinstalled on a device?
The SCCM collection will automatically detect the installation during the next hardware inventory cycle, and the device will be re-added to the collection, triggering the uninstall programme again.
Glossary
SCCM: System Center Configuration Manager, a software management suite by Microsoft that allows for managing large groups of computers.
WQL: WMI Query Language, a subset of SQL used to query information from the Windows Management Instrumentation (WMI).
Collection: In SCCM, a collection is a group of resources, such as devices or users, that are targeted for software deployments or configurations.
Share this content: