I don't see "officelocation" or "office" in the list of acceptable property names here: https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership
dynamic membership rule
Hi All
We are using exchange 2016 hybrid environment, we create users in onprem and migrate to online. In Azure AD I can see Office location for the users i.e it is synced from onprem to azure AD.
I want to create dynamic unified group for one office location lets say office location is abc. In abc location, some users have office location as abc and for some users office location is remote, abc. I want pull users with office location abc and abc, remote. In Azure AD for the unified group, under dynamic membership rules i want to try the below queries but i am not sure, please guide me.
(user.Office location -eq "*abc*") -or (user.Office location -eq "*abc*" and "*remote*" )
(user.Office location -contains "*abc*") -or (user.Office location -eq "*abc*" and "*remote*" )
I am only looking for key words abc ,remote, after abc or before abc, after remote or before remote it can be anything.
3 answers
Sort by: Most helpful
-
-
Yuki Sun-MSFT 37,366 Reputation points
2023-10-30T02:19:51.4+00:00 Hi @Rising Flight ,
I want pull users with office location abc and abc, remote.
Based on my test, office location field is corresponding to the property "physicalDeliveryOfficeName".
So, I‘d recommend using the syntax below instead:
(user.physicalDeliveryOfficeName -eq "abc") -or (user.physicalDeliveryOfficeName -eq "Remote, abc") -or (user.physicalDeliveryOfficeName -eq "abc, Remote")
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.
-
Sandeep G-MSFT 11,331 Reputation points Microsoft Employee
2023-10-30T11:06:17.3733333+00:00 Thank you for posting this in Microsoft Q&A.
As Rich Matheisen mentioned, there is no "officelocation" or "office" attributes which are shown for dynamic group rules.
https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership
I have checked this in my lab and when we pull the user properties from Azure AD, I found that Office location attribute is set in Azure AD as user attribute "physicalDeliveryOfficeName".
To filter users with office location you will have to use the "user.physicalDeliveryOfficeName -eq "value"" in your rule that you create.
You can use the rule as below and this should work for you,
(user.physicalDeliveryOfficeName -eq "abc") -or (user.physicalDeliveryOfficeName -eq "Remote, abc") -or (user.physicalDeliveryOfficeName -eq "abc, Remote")
Let me know if you have any further questions.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.