Configure dynamic membership with the memberOf operator
Microsoft's edit ·
Microsoft's commit message in MicrosoftDocs/entra-docs · commit f8360d6 · +16 −1 lines · also on GitHub
⋯ 56 unchanged lines
5757
1. Select **Add dynamic query**.
5858
1. MemberOf isn't yet supported in the rule builder UI. Select **Edit** to write the rule in the **Rule syntax** box.
5959
1. Example user rule: `user.memberof -any (group.objectId -in ['groupId'])`
60
− 1. Example device rule: `device.memberof -any (group.objectId -in ['groupId'])`
60
+ 1. Example device rule: `device.memberof -any (group.objectId -in ['groupId'])`
61
+
62
+> [!NOTE]
63
+> Replace `'groupId'` with the **object ID of the source group** whose members you want to include in the dynamic group.
64
+>
65
+> The two examples are alternatives:
66
+>
67
+> - Use the **user** rule when creating a **Dynamic user** group.
68
+> - Use the **device** rule when creating a **Dynamic device** group.
69
+>
70
+> To include multiple source groups, specify multiple group object IDs. For example:
71
+>
72
+> ```text
73
+> user.memberof -any (group.objectId -in ['<groupObjectId1>', '<groupObjectId2>'])
74
+> ```
75
+
6176
1. Select **OK**.
6277
1. Select **Create group**.
Microsoft's Markdown source from MicrosoftDocs/entra-docs, © Microsoft Corporation, under MIT. Changed lines with up to 3 unchanged lines around each; ChangeIntel kept this copy today 06:21 UTC. The commit date is when the source changed, which can be hours or days before Learn published it.