A MahApps.Metro WPF GUI for managing MECM (Configuration Manager) device collections with an offline WQL editor. Bypass the slow console query editor -- load all collections into a local grid, edit WQL queries in a fast monospace editor, validate, preview results, and apply changes in bulk.
Ships with a template library: 225 ready-made operational queries and 20 parameterized WQL templates.
- Windows 10 / 11
- PowerShell 5.1
- .NET Framework 4.7.2+
- Configuration Manager console installed (provides the
ConfigurationManagerPowerShell module)
-
Download the release zip and extract it to a working folder.
-
Right-click
start-collectionmanager.ps1-> Run with PowerShell, or from a PowerShell prompt:powershell -ExecutionPolicy Bypass -File start-collectionmanager.ps1
-
Click the Options button on the sidebar and set your Site Code and SMS Provider.
-
Click Refresh to load every device collection.
The shell uses a sidebar layout with three views and an Options modal:
- Collections -- master-detail grid of every device collection: Name, ID, Member Count, Limiting Collection, Refresh Type, Comment. Detail panel tabs: Properties, Direct Members, Query Rules, Include Rules, Exclude Rules. Filter by membership shape (Built-in / Custom / Empty / Has direct members / Has query rules) or free text.
- WQL Editor -- pick a collection, pick a rule, edit the WQL in the monospace editor, click Validate Query to syntax-check via
Invoke-CMWmiQuery, click Preview Results to see how many devices match. Add, Update, or Remove rules with single clicks. - Templates -- two tabs (Operational, Parameterized). Pick a template; for parameterized ones, fill in the parameters and watch the expanded WQL update live. Then Copy to WQL Editor for hand-tuning, or Apply to Collection to push the rule onto a target collection.
- Collections view -> New Collection. Pick name, limiting collection, comment, refresh type. Click Create.
- To clone an existing one: select the source row, click Copy..., name the clone, click Copy.
- Select a collection on the Collections view.
- Click Edit Membership... to open the modal: add devices by name (auto-resolves Resource ID), remove selected members in bulk with confirmation.
- Switch to WQL Editor view.
- Pick a target collection.
- Type or paste the WQL. Click Validate Query to syntax-check.
- Click Preview Results to count matches.
- Type a rule name and click Add Rule.
- Switch to Templates view -> Operational tab.
- Pick a template (e.g., "Workstations | Windows 11 24H2"). The expanded WQL appears in the right pane.
- Click Apply to Collection..., pick a target, confirm the rule name, click Apply.
- Templates view -> Parameterized tab.
- Pick a template (e.g., "Software Installed by Name").
- Fill in the parameters (e.g., SoftwareName =
7-Zip). The expanded WQL updates live. - Apply to Collection... or Copy to WQL Editor for further tuning.
Operational: Clients, Clients Version, Hardware Inventory, Laptops, Microsoft 365 Apps Build Version / Channel, Mobile Devices, Office 365 Build / Channel (legacy), Project, SCCM Infrastructure, Servers, Software Inventory, System Health, Systems, Visio, Windows Update Agent, Workstations.
Parameterized: Software (Installed / Not Installed by Name, Version), OS Build, Client Version, Manufacturer, Model, HW / SW Inventory Reporting, AD OU, Created Within N Days, Chassis Type, TPM, Disk Space, RAM, IP Subnet, Domain, BIOS Version, BitLocker, Last Boot.
collectionmanager/
+- start-collectionmanager.ps1 # WPF shell
+- MainWindow.xaml # Main window layout
+- Lib/ # Vendored MahApps.Metro 2.4.10
+- Module/
| +- CollectionManagerCommon.psd1 # Module manifest
| \- CollectionManagerCommon.psm1 # Business logic (28 functions)
+- Templates/
| +- operational-collections.json # 225 ready-made queries
| \- parameterized-templates.json # 20 parameterized templates
+- Logs/ # Session logs (per-run)
+- Reports/ # CSV / HTML exports
+- CHANGELOG.md
+- LICENSE
\- README.md
- Built-in collections (SMS prefix) cannot be deleted.
- Confirmation dialogs before every destructive operation (collection removal, member removal, query-rule removal).
- WQL validation before applying query rules.
- Lazy loading of direct members keeps refreshes bounded for large environments.
This project is licensed under the MIT License.
Jason Ulbright
Ready-made operational collection queries adapted from SystemCenterDudes / prae1809/PowerShell-Scripts.
