How to add/remove allow sender of distribution group with powershell?

Dear all,

Please help me about how to add/remove allow sender of distribution group with Powershell?

Thanks a lot.

Answer
Answer

Hi Linh,

We need to connect to Exchange online first in powershell. And here is the command to edit the allow list:

set the allow list users addresses:

Set-DistributionGroup "group name" –AcceptMessagesOnlyFrom user1@domain.com,user2@domain.com

add the specific users to allow list:

Set-DistributionGroup "group name" –AcceptMessagesOnlyFrom @{add="user3@domain.com","user4@domain.com"}

remove the specific users to allow list:

Set-DistributionGroup "group name" –AcceptMessagesOnlyFrom @{remove="u3@domain.com","user4@domain.com"}

use the following command to check the allow list users:

Get-distributiongroup -identity "group name" | fl acceptmessagesonlyfrom

Reminder: we need to type "" in the command in powershell. 

Please provide a screenshot of the command if there is any error. For privacy, please provide the command via private message. 

Regards,

Hans

15 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated May 9, 2024 Views 35,716 Applies to: