Dynamic Group rule MemberOf another group but exclude a few users

Filbrun, Jordan A 0 Reputation points
2024-08-27T19:48:30.7833333+00:00

I have a dynamic group that I am struggling to get working. Here is the rule syntax:

user.memberof -any (group.objectId -in ['objectID']) -AND (user.userPrincipalName -notIn ["user1@contoso.com","user2@contoso.com"])

The group has all regular employees at the company, and I want to exclude just a few members. Why is this syntax not working? It works with everything before the -AND but adding the second part breaks it.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,367 questions
{count} votes

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.