A dynamic security group must include every user whose department attribute is Sales or Marketing, and nobody else. Each user has exactly one department value. Which membership rule meets the requirement?
Choose one.
Dynamic membership rules combine attribute expressions with logical operators, and the operator choice decides who matches.
With one department value per user, either-or membership is an -or of two equality checks on department. Joining them with -and requires one value to equal two strings, which matches nobody. Swapping one condition to jobTitle tests the wrong attribute. Using -ne with -or is true for every user, since nobody can equal both values. The -in operator with a list would also work, but it is not offered here.
- Translate 'Sales or Marketing' into two equality expressions on department.
- Join them with -or because a user only needs to satisfy one.
- Check the edge cases: -and matches none, -ne with -or matches all.
Exam tip: Either-or membership on one attribute is -or of -eq expressions (or -in); -and on one single-valued attribute matches nobody.
Manage Microsoft Entra Users and Groups (AZ-104) — the lesson that teaches this.