Commands › Exchange Online

Get-DistributionGroup

Exchange Online ExchangeOnlineManagement Get-*

View existing distribution groups or mail-enabled security groups. To view the members of a group, use the Get-DistributionGroupMember cmdlet.

Quick start script

# Get-DistributionGroup — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Get-DistributionGroup | Format-List

# 3. Export for evidence / drift tracking
Get-DistributionGroup | Export-Clixml .\DistributionGroup-$(Get-Date -Format yyyyMMdd).xml

Syntax — 3 parameter sets

AnrSet

Get-DistributionGroup [-Anr <String>]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-Filter <String>]
 [-IgnoreDefaultScope]
 [-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromWithDisplayNames]
 [-IncludeBypassModerationFromSendersOrMembersWithDisplayNames]
 [-IncludeGrantSendOnBehalfToWithDisplayNames]
 [-IncludeManagedByWithDisplayNames]
 [-IncludeModeratedByWithDisplayNames]
 [-OrganizationalUnit <OrganizationalUnitIdParameter>]
 [-ReadFromDomainController]
 [-RecipientTypeDetails <RecipientTypeDetails[]>]
 [-ResultSize <Unlimited>]
 [-SortBy <String>] [<CommonParameters>]

Identity

Get-DistributionGroup [[-Identity] <DistributionGroupIdParameter>]
 [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-Filter <String>]
 [-IgnoreDefaultScope]
 [-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromWithDisplayNames]
 [-IncludeBypassModerationFromSendersOrMembersWithDisplayNames]
 [-IncludeGrantSendOnBehalfToWithDisplayNames]
 [-IncludeManagedByWithDisplayNames]
 [-IncludeModeratedByWithDisplayNames]
 [-OrganizationalUnit <OrganizationalUnitIdParameter>]
 [-ReadFromDomainController]
 [-RecipientTypeDetails <RecipientTypeDetails[]>]
 [-ResultSize <Unlimited>]
 [-SortBy <String>] [<CommonParameters>]

ManagedBySet

Get-DistributionGroup [-Credential <PSCredential>]
 [-DomainController <Fqdn>]
 [-Filter <String>]
 [-IgnoreDefaultScope]
 [-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames]
 [-IncludeAcceptMessagesOnlyFromWithDisplayNames]
 [-IncludeBypassModerationFromSendersOrMembersWithDisplayNames]
 [-IncludeGrantSendOnBehalfToWithDisplayNames]
 [-IncludeManagedByWithDisplayNames]
 [-IncludeModeratedByWithDisplayNames]
 [-ManagedBy <GeneralRecipientIdParameter>]
 [-OrganizationalUnit <OrganizationalUnitIdParameter>]
 [-ReadFromDomainController]
 [-RecipientTypeDetails <RecipientTypeDetails[]>]
 [-ResultSize <Unlimited>]
 [-SortBy <String>] [<CommonParameters>]

Parameters (19)

ParameterTypeRequiredWhat it controls
-Identity DistributionGroupIdParameter The Identity parameter specifies the distribution group or mail-enabled security group that you want to view. You can use any values that uniquely identifies the group. For example:
-Anr String The Anr parameter specifies a string on which to perform an ambiguous name resolution (ANR) search. You can specify a partial string and search for objects with an attribute that matches that string. The default...
-Credential PSCredential The Credential parameter specifies the username and password that's used to run this command. Typically, you use this parameter in scripts or when you need to provide different credentials that have the required permissions.
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-Filter String The Filter parameter uses OPATH syntax to filter the results by the specified properties and values. The search criteria uses the syntax `"Property -ComparisonOperator 'Value'"`.
-IgnoreDefaultScope SwitchParameter This parameter is available only in on-premises Exchange.
-IncludeAcceptMessagesOnlyFromDLMembersWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeAcceptMessagesOnlyFromSendersOrMembersWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeAcceptMessagesOnlyFromWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeBypassModerationFromSendersOrMembersWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeGrantSendOnBehalfToWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeManagedByWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-IncludeModeratedByWithDisplayNames SwitchParameter This parameter is available only in the cloud-based service.
-ManagedBy GeneralRecipientIdParameter The ManagedBy parameter filters the results by the owner of the group. You can use any value that uniquely identifies the owner. For example:
-OrganizationalUnit OrganizationalUnitIdParameter The OrganizationalUnit parameter filters the results based on the object's location in Active Directory. Only objects that exist in the specified location are returned. Valid input for this parameter is an...
-ReadFromDomainController SwitchParameter This parameter is available only in on-premises Exchange.
-RecipientTypeDetails RecipientTypeDetails[] The RecipientTypeDetails parameter filters the results by the specified distribution group subtype. Valid values are:
-ResultSize Unlimited The ResultSize parameter specifies the maximum number of results to return. If you want to return all requests that match the query, use unlimited for the value of this parameter. The default value is 1000.
-SortBy String The SortBy parameter specifies the property to sort the results by. You can sort by only one property at a time. The results are sorted in ascending order.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.