Send & Receive Issues

Manage Allowed Senders in Exchange Online Distribution Group via PowerShell

Emma BrownEmma Brown Oct 10, 2026 870 views

Question details

The user wants to manage the list of allowed senders for an Exchange Online distribution group using PowerShell.

Manage Allowed Senders in an Exchange Online Distribution Group with PowerShell
Product
Exchange Online
Device & OS
not provided
Scenario
Administrating email distribution group permissions and restricting senders via the command line.
Observed behavior
Adding, removing, or viewing specific users who are permitted to send messages to a targeted distribution list.
Before you start

Ensure you have the appropriate Exchange Online administrator permissions and have successfully connected to the Exchange Online PowerShell module.

Solution 1Recommended

Add or Remove Allowed Senders Using Set-DistributionGroup

Modify the list of users authorized to send messages to a specific distribution group without overwriting the entire existing list.

Using the Add and Remove hash table syntax ensures that you append or subtract specific email addresses from the allowed senders list rather than accidentally overwriting the existing permissions.

1
Connect to Exchange Online

Open PowerShell as an administrator and run the standard command to connect to your Exchange Online environment using your admin credentials.

2
Add a new sender

Run the command: Set-DistributionGroup -Identity "All Security Insurance" -AcceptMessagesOnlyFrom @{Add="user@example.com"}. Make sure to include the hyphen before the parameter name.

3
Remove an existing sender

To revoke permission for a specific user, replace 'Add' with 'Remove' in the command: Set-DistributionGroup -Identity "All Security Insurance" -AcceptMessagesOnlyFrom @{Remove="user@example.com"}.

Add or Remove Allowed Senders Using Set-DistributionGroup
Command Syntax Tip: Always remember to precede parameter names like AcceptMessagesOnlyFrom with a hyphen (-) to avoid command line syntax errors.
Free Microsoft Office alternative

Looking for a Seamless Office Experience? Try WPS Office

While managing Exchange Online requires Microsoft's administrative tools, your daily document and spreadsheet tasks don't have to be expensive or complicated. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office.

Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight installation ensures blazing fast performance on any device.Familiar user interface for seamless migration with zero learning curve.Integrated toolkit with robust PDF editing and document conversion tools.
microsoft office alternative - wps office

Frequently Asked Questions

Do I need special permissions to run Set-DistributionGroup?

Yes, you must be assigned the appropriate Exchange admin roles, such as the Exchange Administrator or Global Administrator role, to manage distribution groups in Exchange Online.

What happens if I omit the '@{Add=}' syntax when updating senders?

If you simply provide an email address or list of addresses without the hash table syntax (e.g., @{Add="..."}), PowerShell will overwrite the entire existing allowed senders list with only the new entries you provided.

Can I allow an entire domain to send messages to a distribution group?

The -AcceptMessagesOnlyFrom parameter is designed for individual senders. To allow groups or broader lists, you should use -AcceptMessagesOnlyFromSendersOrMembers and specify a security group containing those specific users.

How do I install the Exchange Online PowerShell module?

You can install the module by opening Windows PowerShell as an administrator and executing the command: Install-Module -Name ExchangeOnlineManagement.