Microsoft Entra identity automation architecture

Microsoft Entra Dynamic Groups Design Guide

Build user and device cohorts from trustworthy attributes, predictable rules, controlled processing, and evidence—not from convenient strings that silently grant licenses, applications, policies, or access.

Prefer to have it done for you? IT Perfection provides Entra ID and Conditional Access setup for companies in Irvine, Orange County and Los Angeles County.

Ali Hassani, CISSP and Certified CISO, IT PerfectionWritten by Ali Hassani, CISSP and C|CISO · 25+ years designing, securing and supporting business networks · Updated November 2026

Two staff members working together on a laptop
ReviewWe review sign-in methods, admin roles and Conditional Access coverage.

Design objective

Automate membership only after the attribute, purpose, and consequence are understood

Microsoft Entra evaluates user or device attributes against a membership rule. Matching objects are added; objects that stop matching are removed. That simple mechanism can drive Microsoft 365 licensing, enterprise application assignment, Intune targeting, Conditional Access scope, collaboration, communications, and other automation. The rule therefore becomes an access-control dependency—not merely a convenience.

Dynamic groups cannot mix users and devices. Security groups can contain either population, while Microsoft 365 groups support dynamic users only. A dynamic group also cannot accept a manual exception: membership belongs to the rule engine. If the business needs discretionary exceptions, use an explicit exception group and design the consuming policy to combine or exclude it safely.

Control principle: never use an attribute for security-sensitive membership until its source, write permissions, normalization, delay, null behavior, and deprovisioning process are documented. A user-editable or weakly governed field can become an unintended route to access.

Minimum design record

  • Group name, object ID, type, purpose, owner, backup owner, and review date
  • Exact rule, attribute sources, allowed values, null handling, exclusions, and sample objects
  • Licensing, applications, Intune, Conditional Access, Teams, SharePoint, or automation dependencies
  • Expected count, acceptable change threshold, processing expectation, and alert or review method
  • Approval, deployment window, validation evidence, pause action, rollback rule, and residual risk

Authoritative input

Prefer attributes governed by HR, identity provisioning, asset management, or endpoint enrollment. Verify who can write them at every connected source.

Deterministic expression

Use exact values and simple operators where possible. Document case behavior, whitespace, collections, missing values, and operator precedence.

Controlled outcome

Inventory every consumer before activation. A correct rule can still cause an unacceptable licensing, access, device, or workload change.

Architecture decisions

Choose the group model before writing the expression

Design choiceUse whenDo not assumeRequired evidence
Dynamic user security groupUser attributes determine security, licensing, application, Conditional Access, communication, or policy scope.A department label is trustworthy, current, or protected from self-write. Validate the source and every writer.Attribute authority, sample inclusions/exclusions, consumer map, license count, and change owner.
Dynamic device security groupDevice attributes determine deployment, update, compliance, application, or policy targeting.A device rule can reference its owner’s user attributes. Microsoft permits device attributes only.Join/registration state, management source, OS/version format, ownership/category quality, sample devices, and stale-device plan.
Dynamic Microsoft 365 groupAutomatic user membership is appropriate for a collaborative Microsoft 365 group.Devices can join, or automation is harmless to Teams, SharePoint, mailbox, Planner, and connected workloads.Collaboration owner, privacy setting, guest behavior, information lifecycle, communication impact, and recovery plan.
Assigned groupMembership needs approval, exceptions, privileged control, or predictable change timing.Manual always means unmanaged. Apply owner, request, review, removal, and evidence controls.Approvers, access workflow, periodic review, joiner/mover/leaver process, and privileged safeguards.
Role-assignable groupMicrosoft Entra roles are assigned through a protected group.Dynamic membership is supported. Role-assignable groups must use Assigned membership.Privileged Role Administrator authority, PIM design, approval, access review, break-glass separation, and audit trail.
Dynamic administrative unitUsers or devices should enter an administrative scope from governed attributes.Its object-type and licensing model are identical to a normal group, or that mixed object types are supported.Scoped-role purpose, P1 coverage, supported cloud, attribute rule, delegated administrators, and boundary tests.
Scale and licensing: a tenant can have up to 15,000 dynamic membership groups. Microsoft requires Entra ID P1 or Intune for Education coverage for each unique user who belongs to one or more dynamic membership groups; device members of dynamic device groups do not require a license. Validate the current tenant agreement before implementation.

Attribute trust

Treat each referenced field as part of the security boundary

User attributes

  • Trace department, company, employee type, country, office, hire date, extension attributes, and other fields to the authoritative system.
  • Confirm synchronized attributes cannot be self-edited in on-premises Active Directory or another connected source.
  • Define spelling, casing, whitespace, allowed values, nulls, future hires, contractors, guests, disabled accounts, and terminations.
  • Separate business identity from license or security intent; a department name alone rarely expresses exceptions or regulatory scope.

Device attributes

  • Verify the actual Entra device object, join type, management state, operating-system value, category, ownership, profile, and extension attributes.
  • Do not use the unsupported organizationalUnit device attribute; do not infer user properties from device ownership.
  • Reconcile duplicate, pending, disabled, stale, hybrid-joined, registered, and re-enrolled device objects before targeting.
  • Test version strings and collection values against Microsoft Graph output instead of assuming how the portal displays them.
Trust testQuestionFailure impactEvidence
AuthorityWhich system owns the value, and which team approves a change?Convenient but unofficial values drive access or license changes.Data dictionary, source mapping, owner, and change workflow.
Write controlWho can modify the field in Entra, AD, HR, Intune, provisioning, or Graph?Self-write or broad help-desk rights enable membership manipulation.ACL/role review, app permissions, provisioning scope, and test account.
QualityAre values normalized, complete, timely, and valid for every population?Nulls, variants, or delayed updates create unexplained inclusion or removal.Value distribution, null rate, exception list, and last-update samples.
LifecycleWhat happens for pre-hires, movers, leaves, guests, contractors, disabled users, and stale devices?Access arrives early, persists late, or disappears during a business transition.Lifecycle test matrix, timestamps, deprovisioning SLA, and fallback.

Rule engineering

Write expressions that operators can explain, test, and reverse

Use the rule builder for simple expressions and the text editor for more complex logic. The builder supports up to five expressions; larger rules require the text box. Parenthesize mixed Boolean logic explicitly. Prefer equality, prefix, or bounded-list comparisons when the attribute contract permits them, and minimize -contains and -match because complex operators can increase processing time.

PatternIllustrative ruleDesign checksCommon defect
Exact user cohort(user.department -eq "Finance") -and (user.accountEnabled -eq true)Controlled vocabulary, disabled-user behavior, guest handling, and department-change timing.Variants such as FIN, Finance Dept, trailing spaces, or null values are ignored.
Approved value listuser.employeeType -in ["Employee","Contractor-Managed"]Allowed-value owner, case, future values, contractor end dates, and exclusion path.A broad negative rule includes every unexpected or newly introduced value.
Device join state(device.deviceTrustType -eq "AzureAD") -and (device.accountEnabled -eq true)AzureAD means Entra joined; ServerAD means hybrid joined; Workplace means registered.Portal terminology is copied into the rule instead of using documented property values.
Version targetingdevice.deviceOSVersion -startsWith "10.0.2"Confirm exact values with Microsoft Graph, test all supported builds, and establish retirement behavior.Lexical matching is mistaken for numeric version comparison.
Nested membership previewuser.memberof -any (group.objectId -in ["group-guid"])Document preview status, supported limits, processing cost, source groups, and alternate design.Preview memberOf becomes a critical dependency without explicit acceptance and rollback.
Security constraint: do not use dynamic membership for a group assignable to Microsoft Entra roles. Microsoft requires Assigned membership for role-assignable groups specifically to prevent attribute or group administrators from indirectly granting themselves a directory role.

Deployment lifecycle

Validate membership and downstream impact before the rule becomes authoritative

Stage 1

Discover

Inventory groups, duplicate purposes, attributes, owners, license coverage, consumers, expected counts, and privileged or regulated use.

Stage 2

Model

Write the rule and a truth table covering positive, negative, null, boundary, guest, disabled, stale, and lifecycle cases.

Stage 3

Validate

Use Validate rules against up to 20 representative users or devices, then expand comparison through Graph exports or controlled reporting.

Stage 4

Pilot

Create a non-production or unassigned pilot group, compare membership, and attach one low-risk consumer at a time.

Stage 5

Promote

Approve, schedule, monitor counts and removals, verify every dependent workload, preserve evidence, and keep pause/rollback authority available.

Portal validation

A directly assigned Groups Administrator can validate up to 20 sample users or devices. An Unknown result requires detail review; it is not evidence of exclusion.

Processing reality

The group overview shows processing status and last membership change. Processing can exceed 24 hours with large tenants, many changes, complex rules, or expensive operators.

Conversion risk

Changing an Assigned group to Dynamic keeps the object ID, but nonmatching members are removed and new matches are added. Test the rule before converting an access-bearing group.

Top risks and common misconfigurations

Block designs that make membership easy to manipulate, hard to explain, or dangerous to change

These defects can turn a minor data-quality issue into widespread access, licensing, collaboration, or endpoint disruption.

Self-writable attribute

A member or broadly privileged operator can change the value that grants access. Review write permissions at Entra and every source directory.

Negative logic as population

A rule such as “not equal Contractor” can include guests, service accounts, null values, future categories, and every unexpected object.

Mixed purpose group

One cohort drives licensing, Conditional Access, applications, Intune, and communications. A single edit creates an unreviewable blast radius.

No null or lifecycle test

Pre-hires, movers, leaves, disabled users, stale devices, and missing attributes behave differently from the ideal sample set.

Preview dependency

The memberOf preview or another constrained feature becomes a critical production dependency without documented limits and fallback.

Count-only validation

The total looks plausible, but important users or devices are silently swapped. Compare identities, not only the aggregate.

Processing delay ignored

Teams expect immediate membership and interpret latency as failure, then make duplicate or conflicting changes.

Manual exception assumed

Operators plan to add a special member directly. Dynamic membership does not permit manual add or remove operations.

No safe stop

Owners cannot identify who may pause processing, detach consumers, restore the previous rule, or communicate impact during a mass change.

Operations and recovery

Monitor cohorts as production automation, not static directory objects

Operating cadence

  • Daily or alert-driven review for failed processing, high-impact count changes, or sensitive consumers
  • Weekly reconciliation of new groups, changed rules, ownerless groups, paused state, and stale pilots
  • Monthly attribute-quality, licensing, application, Intune, Conditional Access, and exception review
  • Quarterly owner attestation, sample validation, dependency testing, duplicate cleanup, and recovery rehearsal
  • Event-driven review after HR schema, sync, provisioning, device enrollment, tenant, merger, or organizational changes

Incident and failback sequence

  1. Confirm the affected group IDs, rule state, processing status, last membership change, and downstream consumers.
  2. Preserve the current and previous rules, member exports, timestamps, audit records, approvals, count history, screenshots, and incident timeline.
  3. Pause the affected rule—or use Microsoft’s controlled pause-all approach only when widespread processing is suspected and authority is explicit.
  4. Contain the consequence: detach or exclude the group from licensing, application, Intune, Conditional Access, or automation where safer than waiting.
  5. Repair the source attribute, expression, synchronization, or consumer; revalidate positive, negative, null, and boundary samples.
  6. Resume in a controlled window, compare adds and removals, verify each workload, document residual risk, and schedule a follow-up review.
Attribute qualityNull rate, invalid values, source lag, unauthorized writers, and exception volume.
Rule qualityValidation pass rate, complexity, expensive operators, unknown results, and undocumented preview use.
Processing healthPending duration, paused groups, last membership change, failed processing, and unexpected deltas.
Control outcomeWrong licenses, access errors, policy mis-targeting, manual workarounds, incidents, and overdue remediation.
Minimum evidence: original and approved rules, group/object IDs, owners, attribute authority and write controls, validation samples, before/after member exports, consumer inventory, processing status, deployment and rollback timestamps, audit records, approver, findings, and next review.

Questions

Microsoft Entra Dynamic Groups Design: common questions

Can a dynamic group contain both users and devices?

No. A dynamic membership rule targets one object type. Security groups may be Dynamic User or Dynamic Device, while Microsoft 365 dynamic groups support users only.

Can an administrator manually add an exception to a dynamic group?

No. The rule engine owns membership. Use a separately governed Assigned exception group in the consuming control when required.

How should a dynamic rule be tested?

Use a truth table, portal validation against representative objects, larger exported comparison, lifecycle and boundary tests, and a low-risk pilot before attaching critical consumers.

How quickly should dynamic membership update?

Processing depends on tenant size, group size, change volume, rule complexity, and operators, and can exceed 24 hours.

Can a dynamic group be assigned a Microsoft Entra directory role?

No. A role-assignable group must use Assigned membership and cannot be dynamic.

What is the safest rollback for a bad rule?

Preserve the original rule and member export, pause processing, contain downstream assignments, correct and validate the rule, and resume during a controlled window.

Ali Hassani, CISSP and Certified CISO, IT Perfection

Who does the work

Written by Ali Hassani, CISSP, C|CISO

Ali Hassani has 25+ years of hands-on experience in IT operations, cybersecurity, Microsoft infrastructure, network security and Azure, and works with businesses in Irvine, Orange County and Los Angeles County. Design, implementation and troubleshooting work is planned and reviewed by Ali personally.

This guide is for education and planning. It does not replace a professional audit, compliance assessment or vendor engineering review. Updated November 2026.

ISC2 CISSP badgeEC-Council Certified CISO (C|CISO) badgeCisco CCNP Routing and Switching badgeMCSE: Server Infrastructure badgeMicrosoft MCSE badgeMCSA: Security badgeCisco CCNA Cybersecurity badgeMCITP badge

Where this guide fits in our work

This guide supports our server hardware installation work for businesses in Irvine and Orange County. If you would rather hand it off, we also provide server management.

Related guides

Need this done for your business?

IT Perfection plans, installs and supports this for companies in Irvine and Orange County

The guides explain the steps. If you would rather have it done, planned and documented by an experienced engineer, these are the services that cover it. Design, implementation and troubleshooting work is planned and reviewed by Ali Hassani personally.

Entra ID and Conditional Access

MFA, sign-in rules and admin roles set up the right way.

View service

Hybrid identity and Entra Connect

On-premises Active Directory and Entra ID kept in sync.

View service

Business password manager rollout

A company password manager deployed and adopted by staff.

View service