Background
I was looking at how to create SCCM collection based on configuration baseline as a validation step before running upgrades on Windows 10 devices.
During this process I wanted to automate collection memberships based on the results of the validation.
It turns out that you can quite easily create SCCM Collection Based on Configuration Baseline.
I’m using this method to verify that our devices fulfill the requirements before assigning the Feature Upgrade.
Solution
All you need to do is navigate to Configuration Baselines to select the baseline you want to use.
Click the Deployments tab and right-click on the deployment name.

Use the Create New Collection option to select what compliance state you want.
This will create a new collection with a query that will contain members based on the compliance state of the baseline.
The new collection will be limited to the target collection of the deployment and the query will look like this.

In my case the CollectionID is the limiting collection and the ComplianceState = 1 equals compliant devices.
If you want to create a collection for all devices that are not compliant, e.g. Unknown, Error and Not Compliant, you can take the query and reverse the ComplianceState =1 to ComplianceState !=”1″

If you want more information you can find related posts here:
Any way you can post your query in text so we can copy/paste?
Hi ,
I have one query whether this collection will populate automatically when ever any non compliant or compliant machine detected in baseline deployment ? or each time you may need to create collection.
Hi!
It depends on the Configuration Baseline deployment evaluation schedule.
The collection uses a query matching the compliance state, so if a new device runs the CB or if a device changes compliance state, it will update.
How long it takes depends on the CB deployment evaluation schedule and the collection evaluation schedule.
You could enable Incremental Update to make it go faster.
Hi whether this collection will autopopulate if we add new machines to the target collection
Hello, I know this post is old but like another request can you provide the text for picture of below? I know I will change the collection ID to my own, but having trouble getting this to work typing all in manually.
“The new collection will be limited to the target collection of the deployment and the query will look like this.”