← cd ~/tools
// tools/dynamic-groups
Dynamic group rule tester
Paste a dynamic membership rule and some users or devices. The tool checks the syntax, explains the rule in plain English, and shows who would be in the group and why, before you save anything in Entra.
Runs entirely in your browser. Nothing you paste is sent anywhere.
Get some test users
Connect-MgGraph -Scopes User.Read.All
Get-MgUser -Top 200 -Property displayName,userPrincipalName,department,jobTitle,country,usageLocation,userType,accountEnabled,companyName,employeeId,city,proxyAddresses,onPremisesExtensionAttributes |
Select-Object displayName,userPrincipalName,department,jobTitle,country,usageLocation,userType,accountEnabled,companyName,employeeId,city,proxyAddresses,
@{n='extensionAttribute1';e={$_.OnPremisesExtensionAttributes.ExtensionAttribute1}} |
ConvertTo-Json -Depth 4 | Out-File users.jsonGood to know
- String and regex comparisons aren't case sensitive, but property names are.
user.Departmentwon't work. - Precedence from highest to lowest: comparisons,
-not,-and,-or, then-anyand-all. Use brackets to make your intent clear. - Microsoft recommends using
-matchand-containsas little as possible, because they make rules slower to process. - Use
-eq nullor-ne nullto test for empty values. Rules can be up to 3,072 characters. - Check who can change an attribute before you base access on it. Some attributes synced from Active Directory can be edited by users themselves.