Forum Discussion
Roger Roger
Apr 28, 2020Iron Contributor
Dynamic AD group
Hi Experts
I am using exchange hybrid environment, all my users are created on onprem and migrated to cloud. for example i have user1 whose department number is 100, every user has department number in AD attribute. i have another user whose department number is 101. my requirement is to add these users to office365 unified group dynamically, i.e user whose department number is 100 or 101 should be added to this office365 group dynamically and if tomorrow employee leaves the company it should be removed automatically,or is it possible to create a dynamic group in Azure AD to pull the members of department 100 and 101 and add this group to office365 unified group. Experts guide me on this.
3 Replies
Sort By
- DavidLundellCopper Contributor
I know this is an oldie but I figured that if anyone looks at this reference we should note that the -in operator is more efficient that -or so I would do this:
user.department -in ["101","102"]
The -in operator is good for up to 15 items
- JordyBlommaertCopper Contributor
Roger Roger I agree with the comment of Victor
Create an O365 Group and use Dynamic User:
Use following dynamic query:
- ViktorHedbergCopper Contributor
Roger Roger Yes, if you have a Azure AD Premium subscription you can utilize Dynamic Groups as per your requirements.
In your case the syntax would be "(user.accountEnabled -eq true) and (user.department -eq "100") or (user.department -eq "101")". This would allow all enabled users with these values in the Department Attribute to be added dynamically to this group. Provided that their account gets disabled when their employment ends, they lose membership to this group.
Regards,
Viktor