Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Exchange / How to Create and Manage Distribution Groups (Lists) in Exchange?

February 20, 2023 ExchangePowerShell

How to Create and Manage Distribution Groups (Lists) in Exchange?

Distribution groups (lists) are a special type of recipients in Exchange. A distribution group has an email address but doesn’t have a mailbox. Emails sent to the distribution list are forwarded to the email addresses of all group members (DL recipients). Distribution groups may be used when you want to send an email to multiple recipients without having to enter each email address separately.

In this article, we’ll look at how to create and manage distribution groups in Exchange (the article is relevant for all supported Exchange versions, including Exchange Online, with some modifications). You can use Exchange Admin Center (EAC) or PowerShell console (Exchange Management Shell) to manage distribution groups.

There are three types of distribution groups in Exchange:

  • Mail-enabled universal distribution groups are used only for the distribution of emails. In common distribution groups (not the security ones), you may allow users to join or exit groups themselves (without membership approval);
  • Mail-enabled universal security groups are used both to send emails and to allow access to resources in the Active Directory domain.
    Tip. Common security groups in AD are populated manually. There is an article on website that tells how to create dynamic user groups in Active Directory using a PowerShell script.
  • Dynamic Distribution Group — members (recipients) are added to such a group automatically based on an LDAP filter.

Static Distribution Groups in Exchange

You can create a distribution list in the Exchange Admin Center (EAC).

  1. Open the EAC console and go to Recipients -> Groups;
  2. Click + and select the Distribution Group; how to create new distribution list on exchange (on-prem or online)
  3. Fill in the basic attributes of the distribution group:
    • Display name is the group name displayed in the address book
    • Alias is the group email address (must be less than 64 characters)
    • Notes – description of the group
    • Organizational unit is an Organizational Unit (OU) a distribution group is created in
    • Owners are the group owners (by default, a person who created a group becomes its owner)
    • Members – allows to add group members (recipients)
    • Choose whether owner approval is required to join the group shows if an owner approval is needed to join a group (the default value is Open: Anyone can join this group without being approved by the group owners, but you can change it to Closed: Members can be added only by the group owners)
    • Choose whether the group is open to leave shows if you need an owner approval to leave the group Create a distribution group (list) using Exchange Admin Center

You can also manage distribution groups from PowerShell (Exchange Management Shell). Let’s learn useful PowerShell commands to manage Exchange distribution lists.

To create a new Exchange distribution group:

New-DistributionGroup -Name “HelpDesk” -SamAccountName “HelpDesk” -OrganizationalUnit “woshub.com/de/munich/groups” -DisplayName "HelpDesk team" -Alias helpdesk

To create an open distribution list:

New-DistributionGroup -Name "ITNews "-Alias itnews –Type Distribution -MemberJoinRestriction open

You can assign mail attributes to universal AD groups only. To change the AD group type from local/domain to universal one, the EMS cmdlet is used:

Set-Group -Identity "WintelTeam" -Universal

or the Set-ADGroup cmdlet from the AD for PowerShell module:

Get-AdGroup "WintelTeam" | Set-ADGroup -GroupScope Universal

By default, you can send emails to an Exchange distribution group only from user email addresses inside your company (to reduce the number of spam mailings). To allow a distribution list to receive external emails, use the following command:

Get-DistributionGroup -identity “HelpDesk”| Set-DistributionGroup -RequireSenderAuthenticationEnabled $False

To disable the email address policy and change the SMTP address of the group:

Set-DistributionGroup -Identity “HelpDesk” -EmailAddressPolicyEnabled $false
Set-DistributionGroup -Identity “HelpDesk” -PrimarySmtpAddress [email protected]

You can add extra SMTP email addresses to the distribution group:

Set-DistributionGroup HelpDesk -EmailAddresses SMTP:[email protected],SMTP:[email protected]

To add a new user address to the distribution group:

Add-DistributionGroupMember -Identity HelpDesk -Member o.brian

To add a list of users to the distribution group from a text file (each new user full name or email address is specified in a new line in the file):

Get-Content C:\ps\new_helpdesk_dl_users.txt | Add-DistributionGroupMember -Identity HelpDesk

If you want to grant users permission to send on behalf of a distribution group, use the following command:

Set-DistributionGroup HelpDesk -GrantSendOnBehalfTo o.brian, t.muller

To display the list of the distribution group members:

Get-DistributionGroupMember –identity HelpDesk

Or you can export the email addresses of the group members to a CSV file:

Get-DistributionGroupMember –identity HelpDesk | ft name, primarysmtpaddress | Export-CSV c:\PS\HelpDesk_dl_members.csv

To remove a user from the distribution list:

Remove-DistributionGroupMember -identity HelpDesk –member t.muller -confirm:$false

To set the maximum message size that may be sent to the distribution group:

Get-DistributionGroup HelpDesk | Set-DistributionGroup -MaxReceiveSize 3MB

Dynamic Distribution Groups in Exchange

The list of members in Exchange dynamic distribution groups is updated automatically based on the criteria (filters) set. Actually, the filters are LDAP queries. Dynamic distribution groups may be created based on different user attributes in Active Directory. For example, the location, department name, job title, etc. Exchange regularly checks and updates the membership of a dynamic distribution group based on information in Active Directory.

You can create a dynamic distribution group using a simple form in the Exchange Admin Center. However, I prefer using PowerShell to do it.

Create and Manage dynamic distribution groups using Exchange Admin Center and PowerShell

Create a simple Exchange dynamic distribution group:
New-DynamicDistributionGroup -Name 'IT department' -RecipientContainer 'woshub.com/it/user' -IncludedRecipients 'AllRecipients' -ConditionalDepartment 'IT department' -OrganizationalUnit 'woshub.com/it/groups/exchange' -Alias itdept

  • RecipientContainer is a container in AD to get recipients from
  • IncludedRecipients is the type of recipients
  • ConditionalDepartment filter recipients by the value of the Company attribute of the AD user.

You can create a dynamic group using an LDAP filter in the RecipientFilter attribute as follows:

New-DynamicDistributionGroup -Name RomeSales -RecipientFilter {RecipientType -eq 'UserMailbox' -and Department -like '*sale*' –and CustomAttribute12 -eq 'IT' –and City -eq 'Rome' -and (Title -like '*head*' -or Title -like '*manager*' -or Title -like '*leader*')} -OrganizationalUnit Users

You can view the list of group members in EAC or using PowerShell:

Get-Recipient -RecipientPreviewFilter (Get-DynamicDistributionGroup -Identity 'RomeSales').RecipientFilter | ft name, primarysmtpaddress

To assign moderators of a dynamic distribution list:

Set-DynamicDistributionGroup HelpDesk -ModeratedBy o.brian, t.muller

To allow sending emails to the distribution group without moderation for the specific users:

Set-DynamicDistributionGroup -Identity RomeSales -BypassModerationFromSendersOrMembers t.muller

To enable delivery of external emails (from outside of the Exchange organization) to a dynamic distribution list, use the command:

Get-DynamicDistributionGroup -identity “HelpDesk”| Set-DynamicDistributionGroup -RequireSenderAuthenticationEnabled $False

1 comment
3
Facebook Twitter Google + Pinterest
previous post
How to Enable Windows Auto Login without a Password
next post
Remote Session Disconnected: No Remote Desktop License Servers/Client Access Licenses Available

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

October 15, 2023

How to Query and Change Teams User Presence...

October 8, 2023

Installing Language Pack in Windows 10/11 with PowerShell

September 15, 2023

1 comment

Jean da Silva December 9, 2021 - 10:08 pm

Can I see who is a member of the Dynamic Group in Outlook using PowerShell?
When I created one in Exchange, I can’t see who is a member of the DL.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Outlook Keeps Asking for Password on Windows
  • How to Manually Configure Exchange or Microsoft 365 Account in Outlook 365/2019/2016
  • Whitelist Domains and Email Addresses on Exchange Server and Microsoft 365
  • Moving Exchange Mailboxes to Different Database
  • FAQ: Licensing Microsoft Exchange Server 2019/2016
  • How to Cleanup, Truncate or Move Log Files in Exchange Server 2013/2016/2019?
  • Search and Delete Emails from User Mailboxes on Exchange Server (Microsoft 365) with PowerShell
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top