Dynamic UG

Roger Roger 7,181 Reputation points
2020-09-21T14:15:43.877+00:00

Hi All

I am using exchange hybrid environment, department and country are synchronize to azure AD from onprem, i want to create office 365 dynamic unified group for Dept01 and Dep02 for the countries Country01, Country02 will the below query work for me.

(user.accountEnabled -eq true) -and ((user.department -eq "Dept01") or (user.department -eq "Dept02")) -and ((user.country -eq "country01") or (user.country -eq "country02"))

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
Microsoft 365 and Office | Office Online Server
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. Lydia Zhou - MSFT 2,386 Reputation points Microsoft Employee
    2020-09-22T03:53:04.533+00:00

    @Roger Roger

    I test in my environment, your dynamic membership rule works well on my side. Here is my test result.

    1) Set department "Dept01" and country "Australia" for user01. Set department "Dept02" and country "China" for user02.
    2) Create the dynamic group and add the dynamic membership rule. Then validate rules, user01 and user02 are validated successfully:
    26305-564.png

    3) Wait for a while, we can check the M365 dynamic group members:
    26200-565.png

    4) Send test messages to the dynamic group, user01 and user02 can receive them successfully:
    26307-566.png


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    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.