How we can add a particular user to 2 different M365 dynamic user groups by adding query in the Dynamic group and making sure other group members are not being removed from any of those groups at all?

Mytoast Admin 115 Reputation points
2024-04-15T14:11:45.7766667+00:00

How we can add a particular user to 2 different M365 dynamic user groups by adding query in the Dynamic group and making sure other group members are not being removed from any of those groups at all?

I have a scenario where there are 2 M365 dynamic user groups and I have a rule based on user location like country for example; US and Japan and now I want a user needs to be added in both groups as the user location US and as per the location its being added in US group but not in Japan group so now how to add it in both the groups without adding and removing other users from those groups?

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
3,813 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,522 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 95,581 Reputation points MVP
    2024-04-15T16:53:20.28+00:00

    Update the membership query with something like this:

    (user.country -eq "Japan") or (user.userPrincipalName -eq "user@domain.com")
    

    The first condition will ensure that only users with location set as Japan are members of the group, and the second one is the exception you can add for this particular user. If multiple users need to be added, you can add additional clauses. Better yet, figure out a more suitable property to use.