Dynamic groups in Microsoft 365 (M365) allow administrators to create groups whose memberships are automatically updated based on specific criteria defined by the administrator. This is especially useful for managing users in large organizations where group memberships need to be kept current without manual intervention. Here’s an explanation of dynamic groups, their use cases, and how to create them in M365.
What is a Dynamic Group?
A dynamic group in M365 automatically adds or removes members based on user attributes such as department, location, job title, and more. These attributes are defined through rules set by the administrator.
Use Cases for Dynamic Groups
- Departmental Groups: Automatically group users based on their department attribute.
- Location-based Groups: Create groups for users in specific locations or offices.
- Role-based Groups: Group users based on their job titles or roles.
- Compliance and Security: Ensure that group memberships are always up to date for compliance and security audits.
How to Create a Dynamic Group in M365
Prerequisites
- You need to have the appropriate administrative permissions.
- Azure Active Directory Premium P1 or P2 license is required for dynamic group membership.
Steps to Create a Dynamic Group
- Go to the Azure AD Admin Center:
- Navigate to the Azure Active Directory Admin Center.
- Navigate to Groups:
- In the left-hand navigation pane, select Groups.
Click All groups to open up the page
- Create a New Group:
- Click on + New group.
- Configure Group Settings:
- Group Type: Select Security or Microsoft 365 depending on your requirement.
- Group Name: Enter a name for the group.
- Group Description: Provide a description for the group.
- Membership Type: Select Dynamic User.
In this case I’m creating a Security Group
- Define Membership Rules:
- Click on Add dynamic query to open the rule builder.
- You can either use the rule builder or write a custom query using the Azure AD query language.
Using the custom query in Azure.
You can add multiple conditions using the Add expression button
Note: M365 allows you to add up to a maximum of five rules.
- Using the Rule Builder:
- Property: Select the user attribute to filter by (e.g., department).
- Operator: Choose an operator (e.g., Equals, Contains).
- Value: Enter the value for the attribute (e.g., Sales).
Example:
(user.department -eq “Sales”)
- Save the Dynamic Query:
- After defining the rules, click Save.
- Create the Group:
- Click Create to finish creating the group.
Conclusion
Dynamic groups in Microsoft 365 provide a powerful and automated way to manage group memberships based on user attributes. By setting up dynamic membership rules, you can ensure that group memberships are always up to date, reducing the administrative overhead and improving accuracy in group-based permissions and communication.
