← Back to articles Entra

Organize Users and Devices with Entra Groups in Intune

Organize Users and Devices with Entra Groups in Intune

The Scenario

Last month, in a bustling mid-sized enterprise with a rapidly growing hybrid work model, we observed increased complexity in managing over 3,000 devices and 5,000 user profiles with our existing Microsoft Intune setup. Ensuring the right policies were applied became a struggle as users and devices were spread across different locations and roles. The variety of device types and usage patterns introduced potential compliance and security vulnerabilities. Recognizing these challenges, we decided to explore how grouping strategies could streamline our Intune management.

Why This Matters

Inefficient management of devices and users isn't just an operational challenge—it poses significant risks to compliance, security, and productivity. Traditional management can lead to policies being incorrectly applied, or worse, not applied at all. What the official docs often gloss over is the critical layer of nuance in customizing group criteria to mirror your organization’s unique structure. This detailed configuration is key to leveraging Intune's full potential, ensuring enterprise-grade protection and seamless operational protocols.

Root Cause Analysis

With Microsoft Entra's robust suite, groups can be created dynamically based on various attributes. Upon investigating, we found that dynamic group creation using Azure AD attributes was central to resolving our issues. Data from the Azure Graph API, combined with PowerShell cmdlets, gave insightful visibility into configurations. For instance, using the Graph API query:

GET https://graph.microsoft.com/v1.0/groups?$filter=startswith(displayName,'Intune')&$count=true

and PowerShell:

<#
.SYNOPSIS Retrieves all Intune related groups.
.NOTES Author: Souhaiel MORHAG | msendpoint.com | GitHub: https://github.com/Msendpoint | License: MIT | Version: 1.0
#>
Connect-MgGraph -Scopes "Group.Read.All"
Get-MgGroup -Filter "startswith(displayName,'Intune')" | Measure-Object

We were able to assess existing group configurations and optimize them for better alignment with our organizational structure.

The Solution

The strategy was to re-organize our grouping logic, leveraging dynamic groups in Entra ID. Here's the complete implementation for one of our key dynamic groups:

<#
.SYNOPSIS Creates a dynamic group for device management.
.NOTES Author: Souhaiel MORHAG | msendpoint.com | GitHub: https://github.com/Msendpoint | License: MIT | Version: 1.0
#>
$dynamicRule = "(device.deviceOSType -eq 'iOS') -or (device.deviceOSType -eq 'Android')"
$params = @{
    'DisplayName' = "Mobile Devices Group"
    'MailEnabled' = $false
    'MailNickname' = 'mobiledevicesgroup'
    'SecurityEnabled' = $true
    'GroupTypes' = @("DynamicMembership")
    'MembershipRule' = $dynamicRule
    'MembershipRuleProcessingState' = "On"
}
New-MgGroup @params

Validating the solution involved ensuring each device type fell into its respective group. Testing policy auto-assignments confirmed streamlined updates, reducing risk and improving compliance.

Scaling Considerations

As device count scales beyond 10,000, performance and stability require significant consideration. The key areas that change include longer synchronization times for groups, impacting how quickly policy updates are propagated across devices. At this scale, leveraging additional Graph API monitoring scripts to assess latency and membership errors becomes critical. Edge cases appear more frequently, illustrating the need for regular rule evaluations and possibly subdividing large groups for more granular control.

Lessons Learned

  • Visualizing real-time membership data is invaluable for dynamic group efficiency.
  • Regularly review and test group membership rules to prevent drift and stale configurations.
  • High-scale deployments need proactive monitoring to prevent potential latency impacts.
  • Beware of attribute inaccuracies; periodic audits of clean Entra directory data are necessary.
  • Encapsulate dynamic rules within well-documented scripts for transparency and easy updates.

By strategically leveraging Entra groups, we optimized our Intune setup, enhancing security and operational efficiency to meet our organizational goals. This approach transformed device management from an arduous process to a seamless, automated workflow.

🎓 Ready to go deeper?

Practice real MD-102 exam questions, get AI feedback on your weak areas, and fast-track your Intune certification.

Start Free Practice → Book a Session
Souhaiel Morhag
Souhaiel Morhag
Microsoft Endpoint & Modern Workplace Engineer

Souhaiel Morhag is a Microsoft Intune and endpoint management specialist with hands-on experience deploying and securing enterprise environments across Microsoft 365. He founded MSEndpoint.com to share practical, real-world guides for IT admins navigating Microsoft technologies — and built the MSEndpoint Academy at app.msendpoint.com/academy, a dedicated learning platform for professionals preparing for the MD-102 (Microsoft 365 Endpoint Administrator) certification. Through in-depth articles and AI-powered practice exams, Souhaiel helps IT teams move faster and certify with confidence.

Popular on MSEndpoint