1 min read

Managing Distribution Groups with PowerShell

Distribution groups are used for sending emails to a group of people without having to type each recipient's name. This guide covers how to manage them using PowerShell.

Parent Topic: PowerShell Exchange Online Commands Related: PowerShell Comprehensive Guide

Prerequisites

Ensure you are connected to Exchange Online:

Connect-ExchangeOnline

Creating a Distribution Group

New-DistributionGroup -Name "All Staff" `
                      -Alias "allstaff" `
                      -PrimarySmtpAddress "allstaff@yourdomain.com" `
                      -Type Distribution

Managing Members

Add a Member

Add-DistributionGroupMember -Identity "All Staff" -Member "jdoe@yourdomain.com"

Remove a Member

Remove-DistributionGroupMember -Identity "All Staff" -Member "jdoe@yourdomain.com" -Confirm:$false

Get Group Members

Get-DistributionGroupMember -Identity "All Staff"

Advanced Settings

Require Sender Authentication

To prevent external senders from emailing the group:

Set-DistributionGroup -Identity "All Staff" -RequireSenderAuthenticationEnabled $true

Moderation

To require approval for messages sent to the group:

Set-DistributionGroup -Identity "All Staff" -ModerationEnabled $true -ModeratedBy "admin@yourdomain.com"

Return to PowerShell Exchange Online Commands