A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.
You may use the following syntax:
import-csv DLs.csv | Foreach-object {Get-distributiongroup -identity $_.alias | Select-object Name,PrimarySMTPAddress,RequireSenderAuthenticationEnabled | Export-csv result.csv -append}
To change the value of RequireSenderAuthenticationEnabled, you may create two csv files, one contains RequireSenderAuthenticationEnabled to be false and the other to be true.
Then use this syntax (modify $false or $true according to the specified csv files in the import-csv part):
import-csv DLs.csv | Foreach-object {Set-distributiongroup -identity $_.alias -RequireSenderAuthenticationEnabled $false}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.