Support
 
Phone Live Chat
 
Support
 
US: +1 888 720 9500
 
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9393

 
 
 
 
 

How to get dynamic distribution groups in Exchange Online

A dynamic distribution group (DDG) is a mail-enabled group in Exchange Online whose membership comes from a recipient filter rather than a fixed list. Being able to retrieve these groups, to list every one in the tenant, find a specific group, and read the filter that defines it, is the basis for auditing mail flow, documenting how groups are scoped, and cleaning up groups that are no longer needed.

PowerShell does this with the Get-DynamicDistributionGroup cmdlet, which returns the groups and their properties. This guide covers how to list and find dynamic distribution groups, and do the same through the Exchange admin center and ManageEngine ADManager Plus.

 
  • Prerequisites
  • PowerShell
  • Exchange admin center
  • ADManager Plus
  • Troubleshooting
  • Why ADManager Plus
  • FAQ
 

Prerequisites

Before you perform any action, a few things need to be in place:

  • Permissions: Reading groups requires the View-Only Recipients role, included in role groups such as Recipient Management and Organization Management.
  • Tools: Install the Exchange Online Management module once, from an elevated PowerShell window:
    Install-Module -Name ExchangeOnlineManagement

Import the module and connect to Exchange Online PowerShell using an account with the required permissions:

Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName admin@zylker.onmicrosoft.com

How to get dynamic distribution groups using PowerShell

List every dynamic distribution group in the tenant

When you run without an identity, Get-DynamicDistributionGroup returns all dynamic distribution groups in the organization. By default, the result stops at 1,000 objects, so add -ResultSize Unlimited to list every group in a larger tenant:

Get-DynamicDistributionGroup -ResultSize Unlimited |
    Format-Table Name, PrimarySmtpAddress, RecipientContainer -AutoSize

Find a specific group by identity, owner, or filter

To retrieve a single group, pass its name, alias, email address, or distinguished name to -Identity:

Get-DynamicDistributionGroup -Identity "Marketing Team"

When you only know part of the name, -Anr (ambiguous name resolution) matches on name, alias, and related fields, and -ManagedBy returns the groups owned by a particular person. For anything more specific, -Filter takes a condition on the groups' own properties:

# Partial-name match
Get-DynamicDistributionGroup -Anr "Marketing"
# Groups owned by a specific user
Get-DynamicDistributionGroup -ManagedBy "jsmith@zylker.com"
# Groups whose name starts with "Sales"
Get-DynamicDistributionGroup -Filter "Name -like 'Sales*'"

Reading a group's RecipientFilter and RecipientContainer

The two properties that define how a dynamic distribution group is scoped are RecipientFilter and RecipientContainer. Pipe a group to Format-List to read them, along with the recipient types it includes:

Get-DynamicDistributionGroup -Identity "Marketing Team" |
    Format-List Name, RecipientFilter, RecipientContainer, IncludedRecipients, RecipientTypeDetails

RecipientFilter holds the OPATH filter that determines membership. A group created with a custom filter shows its full OPATH expression here (for example, a condition on RecipientTypeDetails and Department), while a group built from pre-canned conditions shows those in the IncludedRecipients and Conditional properties instead. RecipientContainer shows the organizational unit (OU) the filter is scoped to if the group is limited to one branch of the directory rather than the whole tenant. Reading these tells you exactly who a group targets without opening the admin center.

Adjusting the filter with Set-DynamicDistributionGroup

Reading a filter often leads to correcting it. The companion cmdlet Set-DynamicDistributionGroup changes a group's filter or properties; for example, to repoint a group at a new OPATH condition:

Set-DynamicDistributionGroup -Identity "Marketing Team" `
    -RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (Department -eq 'Marketing')"

Exporting the dynamic distribution group inventory to CSV

To document every group and its filter, select the properties you want and pipe them to Export-Csv with a full file path. This produces a complete inventory, one row per group, with the filter and owner of each, ready for an audit or a review. Adding -Encoding UTF8 keeps names with non-ASCII characters intact.

Get-DynamicDistributionGroup -ResultSize Unlimited |
    Select-Object Name, PrimarySmtpAddress, RecipientFilter, RecipientContainer, ManagedBy |
    Export-Csv -Path "C:\Reports\DDG-Inventory.csv" -NoTypeInformation -Encoding UTF8
How to get the members of a dynamic distribution group

Because a dynamic distribution group has no stored member list, listing who belongs to it is a separate operation from retrieving the group: You resolve the group's filter into the recipients it currently matches, or use the Get-DynamicDistributionGroupMember cmdlet in Exchange Online.

Supported parameters

The parameters below are used for retrieving dynamic distribution groups in Exchange Online PowerShell.

Parameter Description
-Identity Retrieves a single group by name, alias, email address, or distinguished name.
-Anr Matches groups on a partial name through ambiguous name resolution.
-ManagedBy Returns the groups owned by a specified user.
-Filter Filters the returned groups by their own properties, such as Name or RecipientContainer.
-ResultSize Sets how many groups to return; Unlimited overrides the default 1,000-object cap.
-RecipientTypeDetails Filters by the recipient subtype where applicable.
RecipientFilter / RecipientContainer Group properties, read with Format-List, that define membership and OU scope.

How to get dynamic distribution groups using the Exchange admin center

If you prefer a graphical view, the Exchange admin center lists dynamic distribution groups for inspection:

  1. Sign in to the Exchange admin center and navigate to Recipients > Groups.
  2. Open the Dynamic distribution list tab to see the dynamic distribution groups in the tenant.
  3. Select a group to open its settings, where you can read its name, owner, email address, and the membership rules that correspond to the RecipientFilter.
Generating the Groups report in the Exchange admin center to list dynamic distribution groups.
Generating the Groups report in the Exchange admin center to list dynamic distribution groups.

The admin center is convenient for inspecting one group, but it has no built-in way to export an inventory of every group, which is where the PowerShell export above or ADManager Plus are better fits.

How to get dynamic distribution groups using ADManager Plus

ADManager Plus is a unified AD, Exchange, and Microsoft 365 management and reporting tool with prebuilt reports for distribution and dynamic distribution groups, so you can list every group and its properties across a tenant without scripting.

  1. Log in to ADManager Plus and navigate to the Reports tab > Microsoft 365 > Reports > Group Reports > Dynamic Distribution Groups.
  2. Select the tenant and click Generate.
  3. Use Export as to download the report in CSV, PDF, XLSX, or HTML formats, or Schedule Reports to email it on a recurring basis.
The Dynamic Distribution Groups report generated using ADManager Plus.
The Dynamic Distribution Groups report generated using ADManager Plus.

Troubleshooting common PowerShell errors

  • The cmdlet isn't recognized: Get-DynamicDistributionGroup is only available after connecting to Exchange Online. Run Connect-ExchangeOnline first, and confirm the ExchangeOnlineManagement module is installed and imported.
  • The object couldn't be found: The -Identity value doesn't match a group. Confirm the exact name or alias by listing the groups first, or use -Anr for a partial-name match.
  • Access is denied: The account lacks a role that can read recipients. Assign a role such as View-Only Recipients or Recipient Management, then reconnect and retry.
  • The CSV export is empty or malformed: Use Export-Csv (not Export -CSV) with a full path such as C:\Reports\DDG-Inventory.csv, and don't pipe through Format-Table before exporting, as it breaks the output.

Limitations of using native tools

Both native methods retrieve dynamic distribution groups reliably, but each has limits that show at scale:

  • The Exchange admin center can't export an inventory: It shows one group at a time with no built-in way to export a list of every group and its filter or to schedule such a report.
  • PowerShell reporting needs scripting: Producing a combined, exportable inventory means writing and maintaining a script. Delivering it on a schedule adds Task Scheduler work on top.
  • Reading OPATH filters takes expertise: A group's RecipientFilter is a raw OPATH expression, which isn't self-explanatory to someone reviewing an export without PowerShell knowledge.
  • Permissions are coarse: Running the cmdlets needs an Exchange role, with no simple way to let a technician report on groups for one business unit only.

How ADManager Plus helps you report on 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

A dynamic distribution group's membership isn't stored on the group, so it's retrieved separately, by resolving the group's filter or using the Get-DynamicDistributionGroupMember cmdlet.

A standard distribution group has a fixed member list that an administrator maintains. A dynamic distribution group has no stored membership; its members are calculated from a recipient filter each time mail is sent to it, so the group stays current on its own as recipients change. You retrieve a standard group with Get-DistributionGroup and a dynamic one with Get-DynamicDistributionGroup.

Read its RecipientFilter and RecipientContainer properties by running the command below:

Get-DynamicDistributionGroup -Identity "Marketing Team" |
    Format-List Name, RecipientFilter, RecipientContainer

RecipientFilter holds the OPATH expression that defines membership and RecipientContainer shows the OU the filter is limited to, if any.

ADManager Plus Trusted By

The one-stop solution to Active Directory Management and Reporting