This guide explains the difference between logical operators And/Or and AndAnd/OrOr in eADM sets and provides recommendations on when to use each type.
While the operators can be confusing, a simple rule of thumb is that AndAnd and OrOr offer better performance and are recommended for simple rule sets where you are not combining conditions.
Operator Definitions
AndAnd / OrOr (Short-Circuit Operators)
The AndAnd and OrOr Operators evaluate rules sequentially and stop processing as soon as the overall result can be determined. This is also known as short-circuit evaluation.
-
AndAnd: If you have a rule
A and B, and conditionAis evaluated tofalse, the system will not evaluate the conditionBbecause the entire expression can never betrue. -
OrOr: If you have a rule
A or B, and conditionAis evaluated totrue, the system will not evaluate the conditionBbecause the entire expression will always betrue.
Note: Using these operators results in faster processing and is the recommended best practice for simple rule sets.
And / Or (Standard Operators)
The And and Or Operators evaluate every rule in the set before returning a final answer. These are used for more complex scenarios where you need to combine different sets of criteria.
Best Practices and Examples
Case 1: Using Only "AND" Logic
If your rule set contains only AND under these conditions, you should use AndAnd for every rule. This provides the best performance.
Example: A user receives a App - Microsoft 365 A3 license if:
-
Their department number is on a specific list,
AND -
Their position type is
ForV,AND -
Their account has not been deactivated.
Case 2: Using Only "OR" Logic
If your rule set contains only OR under these conditions, you should use OrOr for every rule to achieve a similar performance benefit.
Example: A user receives a M365-E5 license if:
-
Their department number is
3705or1125,OR -
Their title is Director, Consultant, or Specialist,
OR -
They are someone's manager.
Case 3: Combining "AND" and "OR" Logic
When you need to mix AND and OR logic, you should use OrOr to distinguish between different sets of criteria, and And to link the rules within each individual set.
In the example below, the rule set consists of two distinct groups of criteria separated by OrOr. A user receives the App-Office 365 E3 license if they meet the requirements in Group 1 OR the conditions in Group 2.
-
Group 1 (Lines 1–2):
-
The department number is on a specific list.
-
ANDthe account has not been deactivated.
-
-
Group 2 (Lines 3–5):
-
The user is a manager.
-
ANDThe organizational chart does not start with "6000". -
ANDthe account has not been deactivated.
-