Exchange Command [EASY]

So I have to execute this command:

Set-Mailbox -Identity "ADGroup" -RequireSenderAuthenticationEnabled $false

For everyone of my distribution lists.

Is there a wildcard I can use or do I have to come up with a script that will query AD for distribution lists and then use a loop to execute this command to all?

LVL 10
ddiazpAsked:
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.

Suliman Abu KharroubIT Consultant Commented:
Had not test it, but it should work:

Get-DistributionGroup | Set-Mailbox -Identity "ADGroup" -RequireSenderAuthenticationEnabled $false
0
ddiazpAuthor Commented:
"ADGroup" is where each DL should be specified, command doesn't work.

Any other suggestions?
0
Dan ArseneauCommented:
That should do it.
$DLs = Get-DistributionGroup -ResultSize unlimited
foreach ($DL in $DLS){Set-DistributionGroup $DL.Name -RequireSenderAuthenticationEnabled:$False}

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ddiazpAuthor Commented:
Awesome, will try that shortly. Can we output to a text file each DL it applies the changes to?

Something like echo/print $DLs > list.log     or something ?
0
Dan ArseneauCommented:
You could just perform the query prior to running the final Set command.
$DLs = Get-DistributionGroup -ResultSize unlimited

foreach($DL in $DLs){if($DL.RequireSenderAuthenticationEnabled -eq $True){Add-Content -Value $DL.Name -Encoding UTF8 -Path C:\list.txt}}

Open in new window

0

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
ddiazpAuthor Commented:
Thank you sir, worked great.
0
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
Exchange

From novice to tech pro — start learning today.

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.