• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 689
  • Last Modified:

need an AD cmdlets or POSH script to change authentication settings on QBDG's

we have a requirement to change the "Message Delivery Restrictions" on 100+ Query based distribution groups [dynamic groups]  to "Accept messages from" "All Senders"

all groups are in one OU.

can someone provide a way to make this change in bulk via script?

many thanks,

  • 3
  • 2
1 Solution
-AcceptMessagesOnlyFrom <MultiValuedProperty>
    The AcceptMessagesOnlyFrom parameter specifies the mailbox users, mail users, and mail contacts that can send e
    -mail messages to this dynamic distribution group. You can also specify Microsoft Exchange as a valid recipient
     for this parameter. If you configure a dynamic distribution group to accept messages only from the Microsoft E
    xchange recipient, the dynamic distribution group only receives system-generated messages.
    You can use any of the following values for the valid senders:
    * DN
    * Canonical name
    * GUID
    * Name
    * Display name
    * Alias
    * Exchange DN
    * Primary SMTP e-mail address
    By default, this parameter is blank, which enables the dynamic distribution group to accept messages from all senders.

For more information for Set-DynamicDistributionGroup, run

Get-Help Set-DynamicDistributionGroup -Full
David CarrCommented:
What is yours currently set to for the groups?
siber1Author Commented:
gkrew, it is currently set to only allow members of one group to send to it. need to clear this on all to allow all auth. to send to them. . thx
WEBINAR: GDPR Implemented - Tips & Lessons Learned

Join the WatchGuard team on Thursday, March 29th as we recount some valuable lessons learned in weighing the needs of a business against the new regulatory environment, look ahead at the two months left before implementation, and help you understand the steps you can take today!

siber1Author Commented:
figured it out. required -AcceptMessagesOnlyFromSendersOrMembers $null

Try this cmdlet

$Dynamic = Import-Csv C:\Dynamic.csv

Foreach ($DL in $Dynamic){

Set-DynamicDistributionGroup -Identity $DL.DynamicName -AcceptMessagesOnlyFrom:$null


Open in new window

Please note DynamicName is your CSV header
siber1Author Commented:
Hi Suriyaehnop, sorry I already assigned the points before I saw your post.

thanks for the response and posh code.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now