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

Anonymous
2018-03-28T03:39:44+00:00

Dear all,

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

Thanks a lot.

Microsoft 365 and Office | Subscription, account, billing | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2018-03-28T05:16:34+00:00

    Hi Linh,

    We need toconnect 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 ******@domain.com**,********@domain.com

    add the specific users to allow list:

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

    remove the specific users to allow list:

    Set-DistributionGroup "group name" –AcceptMessagesOnlyFrom @{remove="******@domain.com**","******@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

    16 people found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-03-28T06:54:43+00:00

    Thank Hans,

    It's work.

    0 comments No comments
  2. Anonymous
    2018-03-28T07:03:49+00:00

    Hi Linh,

    You are welcome. If there is any other question, please submit a new thread in community and we are glad to help you.

    Regards,

    Hans

    1 person found this answer helpful.
    0 comments No comments