AAD Dynamic Group rule Syntax for combination of values

63608335 126 Reputation points
2022-11-30T20:34:06.257+00:00

Hi
I need to create a dynamic group with the following rules:

The logic I need:
People from the following offices:
Office A, Office B, Office C, Office D, Office E, Office F
and with the following Job titles:
Title A, Title B, title C

So any user with a combination of those locations and titles needs to be added to the group.

I have started adding the following but I will need 154 lines of rules if I add it like this:

user.jobTitle -eq "Regional Director") and (user.physicalDeliveryOfficeName -startsWith "Bakersfield") or
(user.jobTitle -eq "Director") and (user.physicalDeliveryOfficeName -startsWith "Bakersfield") or
user.jobTitle -eq "Regional Director") and (user.physicalDeliveryOfficeName -startsWith "Austin") or
(user.jobTitle -eq "Director") and (user.physicalDeliveryOfficeName -startsWith "Austin") or

Hope there is a shorter way to do this (:
And if not I hope that I can have so many rules.

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2022-12-01T02:26:11.633+00:00

    Hi @63608335

    The following logic should work for you (replace the example with your real names):

    ((user.physicalDeliveryOfficeName -eq "Office A") or (user.physicalDeliveryOfficeName -eq "Office B") or (user.physicalDeliveryOfficeName -eq "Office C") or (user.physicalDeliveryOfficeName -eq "Office D") or (user.physicalDeliveryOfficeName -eq "Office E") or (user.physicalDeliveryOfficeName -eq "Office F")) and ((user.jobTitle -eq "Title A") or (user.jobTitle -eq "Title B") or (user.jobTitle -eq "Title C"))

    Try it out and let me know how it goes.

    -----------------------------------------

    If this is helpful please accept answer.

    0 comments No comments

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.