Dynamic distribution groups are mail-enabled [[Windows Active Directory (AD)|Active Directory]] group objects that are created to expedite the mass sending of email messages and other information within a [[Microsoft Exchange]] organization.
Unlike regular distribution groups that contain a defined set of members, the membership list for dynamic distribution groups is calculated each time a message is sent to the group, based on the filters and conditions that you define. When an email message is sent to a dynamic distribution group, it's delivered to all recipients in the organization that match the criteria defined for that group.
# View members of a dynamic distribution group^[[View members of a dynamic distribution group | Microsoft Learn](https://learn.microsoft.com/en-us/exchange/recipients/dynamic-distribution-groups/view-dynamic-distribution-group-members?view=exchserver-2019)]
```PowerShell
$dynamicGroup = Get-DynamicDistributionGroup -Identity 'All Company'
Get-Recipient -RecipientPreviewFilter ($dynamicGroup.RecipientFilter)
```
# Create dynamic distribution group that excludes shared mailboxes
```PowerShell
Set-DynamicDistributionGroup 'All Company' -RecipientFilter {
(-not(RecipientTypeDetailsValue -eq 'SharedMailbox')) -and
(-not(RecipientTypeDetailsValue -eq 'RoomMailbox')) -and
(-not(RecipientType -eq 'MailContact')) -and
(-not(RecipientType -eq 'MailUniversalDistributionGroup')) -and
(-not(RecipientTypeDetailsValue -eq 'EquipmentMailbox')) -and
(-not(RecipientType -eq 'DynamicDistributionGroup')) -and
(-not(RecipientType -eq 'MailUniversalSecurityGroup'))
}
```