How to create a dynamic distribution group in Exchange Online

Last updated on:

A dynamic distribution group is a mail-enabled group in Microsoft Exchange Online whose membership is not maintained manually. Instead of adding and removing people manually, you define a recipient filter with conditions such as department or company. Exchange Online uses these recipient attributes to maintain a calculated group membership list, which is refreshed at least once every 24 hours. This keeps a department or location mailing list accurate on its own as people join, move, and leave.

There are three practical ways to create one: with the New-DynamicDistributionGroup cmdlet in Exchange Online PowerShell, the Exchange admin center (EAC), and ManageEngine ADManager Plus. This guide covers all three, along with how to build and preview recipient filters and how to troubleshoot a group that returns the wrong members.

How a dynamic distribution group differs from a static one

A regular (static) distribution group has a fixed member list that an administrator maintains. A dynamic distribution group has no stored membership at all; its members are calculated whenever mail is sent to it by evaluating the recipient filter against the current directory. The advantage is that the group never goes stale, so a group defined as everyone in Sales always reaches the current sales staff. The trade-off is that you can't add a separate member who does not match the filter, and membership is only as accurate as the recipient attributes the filter depends on. Because membership is recalculated at send time, there is no manual conversion from a static list to a dynamic one; you create a new dynamic distribution group whose filter matches the intended people.

Prerequisites

  • Required permissions: Creating a dynamic distribution group requires the Distribution Groups or Recipient Management role in Exchange Online, both of which are included in the Organization Management role group.
  • Recipient attribute requirements: Populate the relevant attributes (through your user-provisioning process or an HR-to-directory sync) before creating a filter that depends on them, and use the preview step later to confirm the filter matches who you expect.
  • Exchange Online PowerShell module: For the PowerShell method, install and connect to the Exchange Online Management module.
  • PowerShell
  • EAC
  • Troubleshooting
  • ADManager Plus
  • Limitations
  • Why ADManager Plus
  • FAQs
 

How to create a dynamic distribution group using PowerShell

New-DynamicDistributionGroup creates the group in one command. There are two ways to define membership, and they are mutually exclusive: precanned filters (the same conditions as the EAC) or a custom recipient filter.

The precanned approach uses IncludedRecipients with one or more Conditional attribute parameters. This creates a group of every mailbox user in the Marketing department:

New-DynamicDistributionGroup -Name "Marketing Team" -IncludedRecipients "MailboxUsers" -ConditionalDepartment "Marketing"

For conditions the precanned parameters can't express, such as combining departments with or logic, use RecipientFilter with an OPATH filter string instead. Note that you can't use RecipientFilter together with IncludedRecipients or the Conditional parameters in the same command:

New-DynamicDistributionGroup -Name "Marketing and Sales" `
-RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (Department -eq 'Marketing' -or Department -eq 'Sales')"

Configuring recipient filters and membership criteria

A custom RecipientFilter is written in OPATH, the filter syntax Exchange uses. Conditions take the form property -operator 'value', and you combine them with logical operators. The operators you will use most are -eq (equals), -ne (not equal), -like and -notlike (wildcard match), and -and, -or, and -not to combine conditions. Wildcards with -like are supported only as a prefix or suffix, such as Department -like 'Sales*'.

Common filterable properties include Department, Company, StateOrProvince, Office, Title, and RecipientTypeDetails. A more selective filter simply chains more conditions:

New-DynamicDistributionGroup -Name "US Sales Managers" `
-RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (Department -eq 'Sales') -and (Title -like 'Manager*') -and (StateOrProvince -eq 'US')"

Custom attribute filtering for advanced segmentation

When the standard attributes don't capture how you need to segment recipients, Exchange provides 15 custom attributes, CustomAttribute1 through CustomAttribute15 (also called extension attributes), that you can populate with any value and filter on. This is the usual way to build a group for a project, a mailing preference, or any grouping that doesn't map to a directory field. For example, assign a project code to CustomAttribute1 and filter on it:

New-DynamicDistributionGroup -Name "Project Falcon" `
-RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (CustomAttribute1 -eq 'Falcon')"

To change a group's filter after creation, use Set-DynamicDistributionGroup -Identity "<name>" -RecipientFilter "<new filter>". The new filter takes effect the next time mail is sent to the group.

Verifying the dynamic distribution group membership

Exchange Online maintains a calculated membership list for each dynamic distribution group. To preview which recipients currently match the group’s filter, retrieve the group and pass its filter to Get-Recipient with -RecipientPreviewFilter:

$DynamicDistributionGroup = Get-DynamicDistributionGroup -Identity "Marketing and Sales"
Get-Recipient -RecipientPreviewFilter $DynamicDistributionGroup.RecipientFilter |
Select-Object Name, PrimarySmtpAddress, Department

The preview helps validate your filter, but its results may differ from the stored membership until the list is refreshed.

Supported parameters and cmdlets

The parameters and cmdlets below are used for dynamic distribution group tasks in Exchange Online PowerShell.

Parameter or cmdlet Description
New-DynamicDistributionGroup Creates the dynamic distribution group.
-Name The name of the group.
-IncludedRecipients The recipient types to include, such as MailboxUsers or AllRecipients (precanned filter).
-ConditionalDepartment A precanned condition; similar parameters exist for company, state, and custom attributes.
-RecipientFilter A custom OPATH filter string; can't be combined with the precanned parameters.
-RecipientContainer Scopes the group to a specific OU or domain.
Get-DynamicDistributionGroup Retrieves a group and its stored filter, used for previewing membership.
Get-Recipient -RecipientPreviewFilter Lists the recipients a filter currently matches.
Set-DynamicDistributionGroup Modifies an existing group, such as changing its filter.

How to create a dynamic distribution group using the EAC

You can also create a dynamic distribution group through the EAC without using PowerShell commands.

  1. Sign in to the Exchange admin center and navigate to Recipients > Groups.
  2. Click Add a group and select Dynamic distribution list as the group type, then click Next.
  3. Enter a name and description for the group, and assign an owner.
  4. Select the members: either all recipient types or specific types, and add rules such as Department equals Sales.
  5. Set the group's primary email address, review the settings, and click Create.
Creating a dynamic distribution group in Exchange Online using the EAC.

Precanned filters in the EAC

The rules you set in the EAC are what Exchange calls precanned filters: built-in conditions based on common recipient attributes, such as department, company, or state or province. They cover most everyday groups (e.g., all mailboxes in Marketing) without any filter syntax. For conditions the EAC form can't express, you use a custom recipient filter.

IncludedRecipients parameter options

Every dynamic distribution group scopes to one or more recipient types through the IncludedRecipients setting, which the EAC exposes as the member-type choice. Its values are AllRecipients, MailboxUsers, MailUsers, MailContacts, MailGroups, and Resources. For a staff mailing list you would use MailboxUsers; AllRecipients includes every mail-enabled object. This setting pairs with the conditional attributes to define who the group contains.

Troubleshooting common issues

  • The group returns no members: The filter matches nothing, usually because the attribute it tests is not populated on the recipients, or the value is spelled differently than the filter expects. Preview the filter with Get-Recipient -RecipientPreviewFilter, then check the actual attribute values on a few users.
  • Recently changed attributes aren't reflected: A dynamic distribution group is evaluated at send time against the directory, but attribute changes can take time to propagate through Exchange Online before the filter picks them up. Allow for propagation, then preview again.
  • A wildcard filter doesn't match: OPATH supports wildcards with -like only as a prefix or suffix ('Sales*' or '*Sales'), not in the middle of a value. Rewrite a mid-string match as two conditions or a different attribute.
  • Someone unexpected is included or excluded: Check IncludedRecipients or the RecipientTypeDetails condition. A group scoped to AllRecipients will include mail contacts and rooms, not just user mailboxes; narrow it to MailboxUsers or add a RecipientTypeDetails -eq 'UserMailbox' condition.
  • A separate user needs to be added: A dynamic distribution group can't hold a member who doesn't match its filter. Either adjust the filter, add a custom attribute value to that person and include it in the filter, or use a static distribution group for that case.

How to create a dynamic distribution group using ADManager Plus

ADManager Plus is a unified AD, Exchange, and Microsoft 365 management and reporting tool that creates dynamic distribution groups through a point-and-click console, including creating many at once from a CSV file, with no filter syntax to write.

Creating a single group

  1. Log in to ADManager Plus and navigate to the Microsoft 365 tab > Management > Group Management > Single Group Creation > Dynamic Distribution Group Creation.
  2. Select the Microsoft 365 tenant and select a creation template if necessary.
  3. Fill in all the required fields and click Create.
Creating a dynamic distribution group in Exchange Online using ADManager Plus.

Verify that the group was created by generating the Dynamic Distribution Groups report.

Creating groups in bulk

  1. Log in to ADManager Plus and navigate to the Microsoft 365 tab > Management > Group Management > Bulk Group Creation > Create Dynamic Distribution Group.
  2. Select the Microsoft 365 tenant and select a creation template if necessary.
  3. Upload a CSV file containing the group details and click Create.
Creating multiple dynamic distribution groups in Exchange Online using a CSV file.

Limitations of using native tools

Both native methods create dynamic distribution groups reliably, but each has limitations that show as the environment and the requirements grow:

  • The EAC only exposes precanned filters: The EAC form handles common conditions like department or company, but it can't express custom OPATH logic such as combining several departments with or or filtering on a custom attribute.
  • The EAC is one group at a time: There is no way to create dynamic distribution groups in bulk from the EAC; each group is built through the form individually.
  • PowerShell syntax is error-prone: A misplaced hyphen, a mistyped attribute name in an OPATH filter, or an unbalanced parenthesis causes the command to fail.
  • Different conditions mean rewriting the command: Changing a group's membership rules, or setting additional properties requires editing the filter string or writing a new command each time rather than adjusting fields in a form.
  • Bulk creation needs custom scripting: Creating many groups at once requires building a CSV-driven loop with error handling, which is extra work to write and maintain.
  • Permissions are coarse: Running the cmdlets or using the EAC needs Exchange role assignments and neither offers a simple way to let a technician create groups only for a specific business unit without granting broader rights.

How ADManager Plus helps you manage Exchange and Microsoft 365 groups

ADManager Plus replaces scripts and one-off portal work with a single console for AD, Microsoft 365, and Exchange management and reporting:

FAQ

The New-DynamicDistributionGroup cmdlet is used to create a dynamic distribution group. For example, run the following command in an Exchange Online PowerShell session after connecting with Connect-ExchangeOnline:

New-DynamicDistributionGroup -Name "Marketing" -IncludedRecipients "MailboxUsers" -ConditionalDepartment "Marketing"

Use -RecipientFilter instead of the conditional parameters when you need custom OPATH logic.

To create a static distribution group, use New-DistributionGroup -Name "<name>" in PowerShell, or Add a group > Distribution in the EAC, then add members explicitly. A static group has a fixed member list you maintain, unlike a dynamic group whose members come from a filter.

No, there is no direct conversion, since a static distribution group and a dynamic distribution group are different object types. To move to a dynamic group, create a new dynamic distribution group with a recipient filter that matches the same people, confirm the membership with the preview command, and then decommission the old static list once you are satisfied it matches.

To view the group's calculated membership in Exchange Online, run:

Get-DynamicDistributionGroupMember -Identity "Marketing"

To preview recipients who currently match the group's filter criteria, run:

$DynamicDistributionGroup = Get-DynamicDistributionGroup -Identity "Marketing"
Get-Recipient -RecipientPreviewFilter $DynamicDistributionGroup.RecipientFilter

For a script-free approach, ADManager Plus offers the Dynamic Distribution Groups report.

The one-stop solution to Active Directory Management and Reporting
Email Download Link Email the ADManager Plus download link