Anavem
Languagefr
How to Validate Microsoft Entra Dynamic Group Membership Rules in Intune

How to Validate Microsoft Entra Dynamic Group Membership Rules in Intune

Learn to test and validate dynamic group membership rules before deployment using the Validate Rules feature in Microsoft Entra ID to ensure accurate targeting for Intune policies.

April 25, 2026 15 min
hardentra-id 9 steps 15 min

Why Validate Microsoft Entra Dynamic Group Membership Rules?

Dynamic groups in Microsoft Entra ID automatically manage membership based on user or device attributes, making them essential for efficient Intune policy deployment and application targeting. However, incorrect rules can lead to security gaps, over-privileged access, or users missing critical applications and policies.

The Validate Rules feature allows you to test membership rules against up to 20 real users or devices before deployment, showing exactly which objects would be included or excluded and why. This prevents costly mistakes and ensures your Intune policies reach the right targets.

What Makes Dynamic Group Rule Validation Critical for Intune?

In Intune environments, dynamic groups drive policy assignments, application deployments, and compliance requirements. A single misconfigured rule can grant unauthorized access to sensitive applications or exclude users from essential security policies. The validation process reveals attribute values, rule evaluation logic, and membership outcomes, giving you confidence before applying changes that affect thousands of users.

This tutorial walks you through the complete validation workflow, from accessing the validation interface to troubleshooting complex rule scenarios. You'll learn to test both simple and advanced rules, interpret detailed validation results, and document your testing process for compliance and change management requirements.

Implementation Guide

Full Procedure

01

Access Microsoft Intune Admin Center and Navigate to Groups

Start by signing into the Microsoft Intune admin center with your administrator credentials. You'll need either Groups Administrator or Intune Administrator role permissions.

https://endpoint.microsoft.com

Once logged in, navigate to the Groups section:

  1. Click on Groups in the left navigation pane
  2. Select All groups from the submenu
Pro tip: If you're using PIM (Privileged Identity Management), activate your Groups Administrator role first to avoid permission errors during validation.

Verification: You should see a list of all groups in your tenant, including both assigned and dynamic groups. Look for the Membership type column to identify dynamic groups.

02

Select or Create a Dynamic Group for Testing

Choose an existing dynamic group or create a new one for testing. Dynamic groups must be either user-based or device-based, not mixed.

To create a new dynamic group:

  1. Click + New group
  2. Set Group type to Security
  3. Enter a descriptive Group name like "Test-DynamicUsers-Validation"
  4. Set Membership type to Dynamic User or Dynamic Device
  5. Click Add dynamic query

For an existing dynamic group, simply click on the group name from the list.

Warning: You cannot mix users and devices in the same dynamic group. Choose one membership type and stick with it throughout your rule validation.

Verification: The group details page should show "Dynamic User" or "Dynamic Device" as the membership type, and you should see a "Dynamic membership rules" tab.

03

Navigate to Dynamic Membership Rules and Access Validate Rules

Access the rule validation interface within your selected dynamic group:

  1. Click on the Dynamic membership rules tab
  2. You'll see the current rule (if any) in the rule editor
  3. Click on the Validate Rules sub-tab or button

The validation interface will load, showing options to add users or devices for testing. This is where you'll test your membership rules against real objects in your tenant.

Current rule example:
(user.department -eq "IT") and (user.accountEnabled -eq true)
Pro tip: Keep the original rule visible in another browser tab so you can reference it while testing different scenarios.

Verification: You should see "+ Add users" or "+ Add devices" buttons, depending on your group type, along with an empty validation results area.

04

Add Test Objects for Rule Validation

Select up to 20 users or devices to test against your dynamic membership rule. Choose a diverse set that includes both expected members and non-members.

For user-based groups:

  1. Click + Add users
  2. Search for users by name, email, or department
  3. Select users from different departments, locations, or roles
  4. Include at least 2-3 users who should match the rule
  5. Include 2-3 users who should NOT match the rule
  6. Click Select

For device-based groups:

  1. Click + Add devices
  2. Search for devices by name or operating system
  3. Select a mix of Windows, iOS, Android devices if applicable
  4. Include devices with different compliance states
  5. Click Select
Warning: The 20-object limit is enforced strictly. If you need to test more objects, run multiple validation sessions with different sets.

Verification: Selected objects appear in the validation panel with their display names and primary attributes visible.

05

Execute Rule Validation and Analyze Results

Run the validation process and examine the detailed results for each test object:

  1. Click Validate (validation may run automatically after selection)
  2. Wait for the validation to complete (usually 10-30 seconds)
  3. Review the Verification details section

The results will show:

  • Membership status: ✓ Member or ✗ Not a member
  • Rule evaluation: Which parts of the rule matched or failed
  • Attribute values: Current values for attributes used in the rule
Example validation result:
User: john.doe@company.com
Status: ✓ Member
Rule evaluation: (user.department -eq "IT") = TRUE
                (user.accountEnabled -eq true) = TRUE
Final result: TRUE (both conditions met)
Pro tip: Pay special attention to users or devices that show unexpected results. This often reveals issues with attribute values or rule logic.

Verification: Each test object shows a clear membership status with detailed rule evaluation breakdown.

06

Test Rule Modifications Before Saving

Use the validation feature to test rule changes before applying them to the live group:

  1. Click Edit to modify the current rule
  2. Make your changes in the rule builder or text editor
  3. Return to the Validate Rules tab
  4. Click Validate again with the same test objects
  5. Compare the new results with previous validation

Common rule modifications to test:

Original: (user.department -eq "IT")
Modified: (user.department -eq "IT") or (user.department -eq "Engineering")

Original: (device.deviceOSType -eq "Windows")
Modified: (device.deviceOSType -eq "Windows") and (device.isCompliant -eq true)

Document the changes and their impact:

  • How many additional users/devices will be included?
  • Are any current members excluded by the new rule?
  • Do the results match your targeting expectations?
Warning: Rule changes can take up to 24 hours to fully process in production. Plan your changes accordingly and avoid frequent modifications.

Verification: The validation results update to reflect your rule changes, showing different membership outcomes for the same test objects.

07

Validate Complex Rules with Advanced Operators

Test advanced rule syntax including wildcards, contains operations, and multiple conditions:

For complex string matching:

user.mail -match ".*@(contoso|fabrikam)\.com$"
user.displayName -contains "Manager"
user.extensionAttribute1 -in ["Value1", "Value2", "Value3"]

For device rules with multiple conditions:

(device.deviceOSType -eq "Windows") and 
(device.deviceOSVersion -match "10\..*") and 
(device.isCompliant -eq true)

Test each component separately:

  1. Start with a simple rule testing one condition
  2. Add complexity gradually
  3. Validate after each addition
  4. Use parentheses to control evaluation order
Pro tip: Use the rule builder for simple conditions (up to 5 expressions), then switch to the text editor for complex logic. The rule builder helps prevent syntax errors.

Common advanced scenarios to test:

  • Multiple department inclusion with OR logic
  • Exclusion patterns using NOT operations
  • Date-based rules for account creation or last sign-in
  • Custom attribute matching for specialized targeting

Verification: Complex rules show detailed evaluation for each condition, helping you understand exactly why objects match or don't match.

08

Document Validation Results and Save Confirmed Rules

Create documentation of your validation process and save the confirmed rule:

  1. Screenshot or export the validation results
  2. Document the test objects used and their outcomes
  3. Note any unexpected results and their explanations
  4. Record the final rule syntax
  5. Click Save to apply the validated rule

Create a validation report template:

Dynamic Group Validation Report
Group Name: [Group Name]
Rule: [Rule Syntax]
Test Date: [Date]
Test Objects: [Count] users/devices
Expected Members: [Count]
Actual Members: [Count]
Discrepancies: [List any unexpected results]
Approved By: [Administrator]
Deployment Date: [Date]
Pro tip: Save validation screenshots in your change management system. They're invaluable for troubleshooting future membership issues.

Post-deployment monitoring:

  • Check group membership after 24 hours
  • Verify that Intune policies are applying correctly
  • Monitor for any user/device complaints about missing access
  • Set up alerts for group membership changes

Verification: The rule is saved and active. You can see the "Last updated" timestamp on the Dynamic membership rules tab, and the group will begin processing membership changes.

09

Troubleshoot Common Validation Issues

Address frequent problems encountered during rule validation:

Insufficient Privileges Error:

# Check your current role assignments
Get-MgRoleAssignment -Filter "principalId eq '[your-user-id]'"

If using PIM, activate your role:

  1. Go to Microsoft Entra admin center
  2. Navigate to Privileged Identity Management
  3. Click My roles
  4. Activate Groups Administrator role

Deprecated Attribute Issues:

Replace deprecated attributes in your rules:

❌ Deprecated: user.organizationalUnit -eq "OU=Sales,DC=contoso,DC=com"
✅ Use instead: user.department -eq "Sales"

Rule Syntax Errors:

  • Use -match ".*pattern.*" for wildcard matching
  • Ensure proper parentheses for complex logic
  • Check attribute names against the official schema
  • Test string comparisons with exact case matching
Warning: Avoid using -contains and -match operators unnecessarily as they can impact performance. Use exact equality (-eq) when possible.

Verification: Run the validation again after fixing syntax errors. All test objects should show clear membership status without error messages.

Frequently Asked Questions

How many users or devices can I test at once with the Validate Rules feature?+
You can validate up to 20 users or devices at once using the Validate Rules feature in Microsoft Entra ID. This limit is strictly enforced, but you can run multiple validation sessions with different sets of objects if you need to test more. The validation typically completes within 10-30 seconds and shows detailed results for each test object including membership status and rule evaluation breakdown.
What permissions do I need to validate dynamic group membership rules in Intune?+
You need either Groups Administrator or Intune Administrator role to validate dynamic group membership rules. If you're using Privileged Identity Management (PIM), you must activate the role first - eligible assignments won't work for validation. The specific permission required is microsoft.directory/groups/dynamicMembershipRule/update. Make sure you have Microsoft Entra ID P1 or P2 licensing to support these administrative roles.
Why does my dynamic group rule validation show different results than expected?+
Common causes include deprecated attributes like organizationalUnit (which is ignored), incorrect syntax for wildcard matching (use -match with .* instead of -contains), case sensitivity in string comparisons, or testing against outdated user/device attributes. The validation shows detailed rule evaluation for each condition, helping you identify which part of your rule is causing unexpected results. Always verify attribute values in the validation results against your expectations.
How long does it take for dynamic group membership changes to take effect after validation?+
While validation is instant, actual dynamic group membership processing can take up to 24 hours to complete after saving rule changes. The validation feature only tests the rule logic - it doesn't immediately update live group membership. Plan your rule deployments accordingly and avoid making frequent changes. You can monitor the group's membership tab to see when processing completes and new members are added or removed.
Can I validate rules for groups that contain both users and devices?+
No, Microsoft Entra dynamic groups must be either user-only or device-only - mixed membership types are not supported. You need to create separate dynamic groups for users and devices, each with their own specific rules and validation. If you need to target both users and devices with Intune policies, create two dynamic groups and assign the same policies to both groups rather than trying to combine them into a single group.

Discussion

Share your thoughts and insights

Sign in to join the discussion