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,

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

-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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.