Close Menu
    Facebook X (Twitter) Instagram
    Saturday, October 11
    X (Twitter) LinkedIn Reddit RSS
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»Intune»Azure Active Directory»Automating Intune Deployment Rings Using Entra ID Dynamic Groups and Regex

    Automating Intune Deployment Rings Using Entra ID Dynamic Groups and Regex

    Eswar KonetiBy Eswar KonetiJuly 01, 10:31 pm3 Mins Read Azure Active Directory 584 Views
    Share
    Facebook Twitter LinkedIn Reddit

    Recently, I came across an insightful blog post on X (formerly Twitter) by Peter, discussing dynamic group creation for Intune deployments. Inspired by that, I wanted to share my own method—using regular expressions (regex) in Entra ID dynamic groups to build deployment rings based on percentage logic for Intune.

    🧩 The Use Case

    Imagine managing 3,000 Windows devices across different locations, regions, or countries. You want to stage your Intune deployments in phases—starting with a pilot, then gradually rolling out to production in multiple rings.

    Here’s a rollout schedule I prefer (though you can adjust the % as needed):

    Ring nameGroup Name% of devices (~)Count of devices
    PilotIntune - Dynamic computers - Pilot5150
    Prod Ring 1Intune - Dynamic computers - Ring 110300
    Prod Ring 2Intune - Dynamic computers - Ring 220600
    Prod Ring 3Intune - Dynamic computers - Ring 325750
    Prod Ring 4Intune - Dynamic computers - Ring 4401200
        
    Total1003000

    🧠 How Does This Work?

    Device object IDs in Entra ID are 32-character hexadecimal strings, ending with a character from (16 combinations): a, b, c, d, e, f, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

    That’s 16 unique characters, and each one represents roughly 6.25% of all possible values. So if we match devices whose object IDs end in certain characters, we can approximate a percentage-based split.

    Approximate Regex Matches by Percentage

    %(~)Regex SuffixMatches Hex Chars
    5%[0]$ or [f]$1 Char
    0%[0f]$2 Char
    20%[0f1]$3 char
    25%[0f12]$4 char
    40%[0f1234]$6 char

    🛠️ Example: Dynamic Group RulesHere’s how the regex-based dynamic rules look for each ring:

    Ring nameGroup Name% of devicesCount of devicesQuery (~ based on hex value)
    PilotIntune - Dynamic computers - Pilot5150(device.deviceId -match "^.*[0]$")
    Prod Ring 1Intune - Dynamic computers - Ring 110300(device.deviceId -match "^.*[0f]$")
    Prod Ring 2Intune - Dynamic computers - Ring 220600(device.deviceId -match "^.*[0f1]$")
    Prod Ring 3Intune - Dynamic computers - Ring 325750(device.deviceId -match "^.*[0f12]$")
    Prod Ring 4Intune - Dynamic computers - Ring 4401200(device.deviceId -match "^.*[0f1234]$")
         
    Total1003000 

    🎯 Real-World Filtering Example

    Here’s a full dynamic membership rule for Windows 10/11 devices that:

    • Start with OS version 10.0.1 or 10.0.2 (windows 10 or Windows 11)
    • Are not MDE Managed
    • Belong to the ~5% Pilot ring
    • you can also add deviceManagementAppId for devices that are SCCM/Intune managed as well https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership
    ((device.deviceOSVersion -startsWith "10.0.1") 
     -or (device.deviceOSVersion -startsWith "10.0.2"))
     -and (device.deviceOSType -startsWith "Windows")
     -and (device.systemLabels -notContains "MDEManaged")
     -and (device.deviceId -match "^.*[0]$")

    🔍 In My Lab

    In my test environment with around 170 devices, using the pilot ring rule (deviceId ends in [0]) results in about 10 devices, which is roughly 6% — as expected.

    📸 Screenshot below showing filtered devices in pilot ring:

    ✅ Summary

    This regex-based approach is a simple, scalable way to:

    • Divide devices into rollout rings
    • Avoid manual tagging or static groups
    • Work with native Entra ID (Azure AD) features

    You can easily adapt this method for 200, 3,000, or even 100,000 devices — and it works seamlessly with Intune, Windows Autopatch, or Feature Update rings.

    device groups Dynamic Dynamic groups Entra Entra ID intune query based Regex based
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    Export Microsoft Entra ID User Authentication Methods to CSV using PowerShell & Microsoft Graph API

    August 13, 2:08 pm

    Exporting Intune Win32 Apps with All Properties Using PowerShell and Microsoft Graph

    June 30, 7:01 pm

    Optimize Your Intune Workflow with a Powerful Browser Extension

    March 22, 10:39 am

    2 Comments

    1. Dave T on July 31, 2025 2:45 AM

      Eswar, this is perfect from my testing so far and something I've wanted to work on for a while. It's a great start and I just have to carve out OS types for my environment. Thank you!

      Reply
      • Eswar Koneti on August 13, 2025 2:10 PM

        Glad it is useful!

        Thanks,
        Eswar

        Reply

    Leave a ReplyCancel reply

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2025 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.

     

    Loading Comments...