Skip to content

Commit bf9dc53

Browse files
authored
Merge pull request #192967 from curtand/jordan0325
[Azure AD groups] tips for more efficient rules
2 parents c02efea + 102d683 commit bf9dc53

File tree

2 files changed

+90
-8
lines changed

2 files changed

+90
-8
lines changed

articles/active-directory/enterprise-users/TOC.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
items:
3535
- name: Users
3636
items:
37-
- name: Create users
37+
- name: Create a user
3838
href: ../fundamentals/add-users-azure-active-directory.md?context=%2fazure%2factive-directory%2fenterprise-users%2fcontext%2fugr-context
39-
- name: Bulk create users
39+
- name: Create users in bulk
4040
href: users-bulk-add.md
4141
- name: Manage user profiles
4242
href: ../fundamentals/active-directory-users-profile-azure-portal.md?context=%2fazure%2factive-directory%2fenterprise-users%2fcontext%2fugr-context
@@ -50,11 +50,11 @@
5050
href: ../fundamentals/active-directory-users-assign-role-azure-portal.md?context=%2fazure%2factive-directory%2fenterprise-users%2fcontext%2fugr-context
5151
- name: User management enhancements
5252
href: users-search-enhanced.md
53-
- name: Bulk delete users
53+
- name: Delete users in bulk
5454
href: users-bulk-delete.md
5555
- name: Restore a deleted user
5656
href: ../fundamentals/active-directory-users-restore.md?context=%2fazure%2factive-directory%2fenterprise-users%2fcontext%2fugr-context
57-
- name: Bulk restore users
57+
- name: Restore users in bulk
5858
href: users-bulk-restore.md
5959
- name: Revoke a user's access
6060
href: users-revoke-access.md
@@ -106,15 +106,17 @@
106106
href: groups-dynamic-membership.md
107107
- name: Validate a membership rule
108108
href: groups-dynamic-rule-validation.md
109+
- name: Create more efficient rules
110+
href: groups-dynamic-rule-more-efficient.md
109111
- name: Change group membership type
110112
href: groups-change-type.md
111-
- name: Bulk add members
113+
- name: Add members in bulk
112114
href: groups-bulk-import-members.md
113-
- name: Bulk remove members
115+
- name: Remove members in bulk
114116
href: groups-bulk-remove-members.md
115-
- name: Bulk download member list
117+
- name: Download member list
116118
href: groups-bulk-download-members.md
117-
- name: Bulk download groups list
119+
- name: Download groups list
118120
href: groups-bulk-download.md
119121
- name: Restore deleted groups
120122
href: groups-restore-deleted.md
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: Create simpler and faster rules for dynamic groups - Azure AD | Microsoft Docs
3+
description: How to optimize your membership rules to automatically populate groups.
4+
services: active-directory
5+
documentationcenter: ''
6+
author: curtand
7+
manager: karenhoran
8+
ms.service: active-directory
9+
ms.subservice: enterprise-users
10+
ms.workload: identity
11+
ms.topic: overview
12+
ms.date: 03/29/2022
13+
ms.author: curtand
14+
ms.reviewer: jordandahl
15+
ms.custom: it-pro
16+
ms.collection: M365-identity-device-management
17+
---
18+
19+
20+
# Create simpler, more efficient rules for dynamic groups in Azure Active Directory
21+
22+
The team for Azure Active Directory (Azure AD) sees numerous incidents related to dynamic groups and the processing time for their membership rules. This article contains the methods by which our engineering team helps customers to simplify their membership rules. Simpler and more efficient rules result in better dynamic group processing times. When writing membership rules for dynamic groups, these are steps you can take to ensure the rules are as efficient as possible.
23+
24+
25+
## Minimize use of MATCH
26+
27+
Minimize the usage of the 'match' operator in rules as much as possible. Instead, explore if it's possible to use the `contains`, `startswith`, or `-eq` operators. Considering using other properties that allow you to write rules to select the users you want to be in the group without using the `-match` operator. For example, if you want a rule for the group for all users whose city is Lagos, then instead of using rules like:
28+
29+
- `user.city -match "ago"`
30+
- `user.city -match ".*?ago.*"`
31+
32+
It's better to use rules like:
33+
34+
- `user.city -contains "ago,"`
35+
- `user.city -startswith "Lag,"`
36+
37+
Or, best of all:
38+
39+
- `user.city -eq "Lagos"`
40+
41+
## Use fewer OR operators
42+
43+
In your rule, identify when it uses various values for the same property linked together with `-or` operators. Instead, use the `-in` operator to group them into a single criterion to make the rule easier to evaluate. For example, instead of having a rule like this:
44+
45+
```
46+
(user.department -eq "Accounts" -and user.city -eq "Lagos") -or
47+
(user.department -eq "Accounts" -and user.city -eq "Ibadan") -or
48+
(user.department -eq "Accounts" -and user.city -eq "Kaduna") -or
49+
(user.department -eq "Accounts" -and user.city -eq "Abuja") -or
50+
(user.department -eq "Accounts" -and user.city -eq "Port Harcourt")
51+
```
52+
53+
It's better to have a rule like this:
54+
55+
- `user.department -eq "Accounts" -and user.city -in ["Lagos", "Ibadan", "Kaduna", "Abuja", "Port Harcourt"]`
56+
57+
58+
Conversely, identify similar sub criteria with the same property not equal to various values, that are linked with `-and` operators. Then use the `-notin` operator to group them into a single criterion to make the rule easier to understand and evaluate. For example, instead of using a rule like this:
59+
60+
- `(user.city -ne "Lagos") -and (user.city -ne "Ibadan") -and (user.city -ne "Kaduna") -and (user.city -ne "Abuja") -and (user.city -ne "Port Harcourt")`
61+
62+
It's better to use a rule like this:
63+
64+
- `user.city -notin ["Lagos", "Ibadan", "Kaduna", "Abuja", "Port Harcourt"]`
65+
66+
## Avoid redundant criteria
67+
68+
Ensure that you aren't using redundant criteria in your rule. For example, instead of using a rule like this:
69+
70+
- `user.city -eq "Lagos" or user.city -startswith "Lag"`
71+
72+
It's better to use a rule like this:
73+
74+
- `user.city -startswith "Lag"`
75+
76+
77+
## Next steps
78+
79+
- [Create a dynamic group](groups-dynamic-membership.md)
80+

0 commit comments

Comments
 (0)