How to Add All Shared Mailboxes to a Dynamic Microsoft 365 Group
Question details
An organization needs a reliable way to automatically add all shared mailboxes to a dynamic Microsoft 365 group without having to manually assign extension attributes to each new mailbox.
- Product
- Microsoft 365
- Device & OS
- not provided
- Scenario
- Automating Microsoft 365 group memberships to dynamically include shared mailboxes.
- Observed behavior
- Currently, administrators must manually assign extensionAttribute1 to new shared mailboxes for them to be picked up by the dynamic group.
Ensure you have Exchange Administrator or Global Administrator privileges in your Microsoft 365 tenant, and verify that you have the appropriate Microsoft Entra ID (Azure AD) P1 or P2 licenses required to use dynamic groups.
Use Microsoft Entra ID Dynamic Membership Rules
Create a dynamic group rule that filters users based on specific attributes related to shared mailboxes.
Microsoft Entra ID (formerly Azure AD) allows you to create dynamic membership rules. While filtering natively by 'Shared Mailbox' recipient type can be tricky, you can often target synchronized on-premises attributes or specific naming conventions.
Log in to the Microsoft Entra admin center as a Groups Administrator or Global Administrator.
Navigate to Groups > All groups. Click 'New group' or select your existing dynamic group. Ensure the Membership type is set to 'Dynamic User'.
Under the dynamic group settings, click 'Add dynamic query' or 'Edit' on the Dynamic membership rules section.
Use the rule builder to filter members. If you sync from on-premises, you can match specific Active Directory properties. For cloud-only environments, consult Microsoft documentation or PowerShell community guides for the most effective property to query for shared mailboxes.
Click 'Save'. The system will evaluate the rule in the background and automatically populate the group with matching shared mailboxes.
Automate Attribute Tagging via PowerShell Script
Use a scheduled PowerShell script to automatically locate shared mailboxes and tag them with the required extension attribute.
Need a Fast and Reliable Office Suite? Try WPS Office
While Microsoft 365 is essential for enterprise mailbox management and dynamic grouping, you may also need a lightweight, cost-effective office suite for daily document tasks. WPS Office provides robust features, excellent performance, and deep compatibility without the heavy overhead.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install WPS Office: Run the downloaded installer and follow the simple on-screen instructions to set up the software.
- 3. Start Working: Open WPS Office to instantly view, create, or edit your documents, spreadsheets, and presentations.

Frequently Asked Questions
Do I need a special license to create dynamic groups in Microsoft 365?
Yes, utilizing dynamic group membership in Microsoft Entra ID (Azure AD) requires an Azure AD Premium P1 or P2 license for each user affected by the rule and for the tenant administrators configuring it.
Why is my new shared mailbox not appearing in the dynamic group immediately?
Dynamic group evaluation in Microsoft Entra ID runs periodically. Depending on the size of your directory and the complexity of your rules, it can take up to 24 hours for the group membership to fully update.
Can I use Exchange Admin Center instead of Entra ID for dynamic mailboxes?
Exchange Admin Center allows you to create Dynamic Distribution Groups specifically for email routing. However, if you need a Microsoft 365 Group (which provides a shared workspace, Teams integration, and SharePoint site), you must configure the dynamic rules via Microsoft Entra ID.




