Forum Discussion
Dynamic Group - Rule Syntax Problems
Hello,
I just started using dynamic groups and I have never worked with Azure rule syntax, so far it's been fun. I have read https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership and can't find my problem. The first dynamic group I created worked like a charm. The second dynamic group I created is for all employees and not departments starting with "convention", "affordable" etc. and it's giving me problems.
This rule works up to (user.department -notStartsWith), so I get like 2900 direct members. What's interesting is if I change the -notStartsWith to -startsWith I get the results I want with 500+ direct members.
(user.accountEnabled -eq true) and (user.userType -ne "guest") and (user.displayName -notContains " - ADM") and (user.department -ne null) and ((user.department -notStartsWith "Convention") or (user.department -notStartsWith "Affordable Housing") or (user.department -notStartsWith "Credit Operations"))
So, why does the -startsWith work and -notStartsWith not give me the results I am looking for. I have struggled for many hours to work out the correct syntax and have failed. You are my only hope, and it is greatly appreciated.
Thanks!
BW