Dynamic Group rule syntax | user.memberof Group-A but not Group-B

Joshua Hardy 20 Reputation points
2023-08-22T08:14:49.6666667+00:00

Hi, I am trying to create a custom rule for a Group with Dynamic assignment.

I basically want to include any Users who are in Group_A but exclude any of those users who are also in Group_B

I have tried many interactions but have not been able to get his to work such as:

user.memberof -any (group.objectId -in ['Group_A_ID'] -and -notin ['Group_B_ID'])

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft Security | Microsoft Graph
Microsoft Security | Microsoft Entra | Other
0 comments No comments
{count} votes

Accepted answer
  1. Tommy Bergman 75 Reputation points
    2023-08-22T13:19:37.1466667+00:00

    I'm afraid it is not possible.

    This is a preview limitation of the memberof function.

    https://learn.microsoft.com/en-us/azure/active-directory/enterprise-users/groups-dynamic-rule-member-of

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.