MMS Tips and Tricks Entry: Collection of Random 10% of the Fleet

May of 2022 marked the return of MMS to the Mall of America. One of the fun events is the Tips & Tricks Showcase on Wednesday evening. It’s an open mic event were anyone can step up and present a tip, trick or something new that they discovered. It’s a fun event and very fast paced (each person has just a few minutes to present).

This year I put myself out there with a tip on how to generate randomly populated collections of given percentages of your fleet.

This post relates back to my larger “Lord of the Deployment Rings: the Intune Towers” post. This is much simpler and (so far) is Configuration Manager only. Oh, and the math is easier too! While my Intune solution relies on the hexadecimal DeviceID from Azure AD, this method uses the ResourceID of the device in ConfigMgr. Since the ResourceID is numeric the breakdown is easier to work out and creating queries that bring in 10%, 1% or even 0.1% are simple to create.

Here is the query:

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_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_COMPUTER_SYSTEM.ResourceID like "%0"

The key piece is the last expression:

SMS_G_System_COMPUTER_SYSTEM.ResourceID like "%0"

That expression will gather all devices where the last digit of the RecourceID is a “0”. Since the ResourceID is numeric (i.e., 0-9) each possible value would cover 10% of the fleet. So, if the scenario was that you needed to do a pilot rollout of an application to a random sampling of 10% of your fleet, this would do the trick.

What if you have a very large population and you need a smaller sample size?

That’s easy, just use the last 2 digits of the ResourceID:

SMS_G_System_COMPUTER_SYSTEM.ResourceID like "%00"

This query would bring in all devices were the last 2 digits of the RecourseID are “00”. This would cover 1% of the fleet.

You can go even smaller:

SMS_G_System_COMPUTER_SYSTEM.ResourceID like "%000"

This will grab devices whose ResourceID ends in “000” or just 0.1% of the fleet.

I use this level (last 3 digits) in our WaaS rollout. We roll out a Feature Update over a number of months, so we can have 100 or more deployment collections. Using the last 3 digits I can randomly scatter devices across these collections and be confidant that I am not overloading any one collection.

For example, on our 20H2 rollout each of my deployment collections had 12-13 queries, with each query bringing in 0.1% of the fleet. This meant each collection would have between 1.2% and 1.3%. Using this fine of a breakdown means that the fleet is very evenly spread across the collections with only being a 0.1% difference between any of them.

Mike Marable

Learn More →

Leave a Reply

Your email address will not be published. Required fields are marked *