Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

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?

0
ddiazp
Asked:
ddiazp
  • 3
  • 2
1 Solution
 
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

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

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

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