Answered by:
powershell command to check sender authentication on groups

Question
-
I need to check a main group and all nested groups in it, for the status of Require All Senders to be authenticated boxes. They all need to be unchecked, so basically I need 2 powershell commands. 1 to check the main group and all nested groups for the status of the box, and the 2nd powershell command to uncheck them. Any help would be appreciated.Thursday, January 21, 2016 3:53 PM
Answers
-
Hi,
No easy one command to get all nested groups in one main group (It's easy for nested members in one group). Here is my suggested procedure.
Run this command on main group to get the groups in the main group and uncheck sender authenticaiton at the same time.
Get-DistributionGroupmember MainGroup | ?{$_.RecipientTypeDetails -like "*group*"} | Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Then replace Maingroup to the group in the result of the command above. Do the same on layer down until the last layer.
Example:
Step1: Get-DistributionGroupmember MainGroup | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Step2: Get-DistributionGroupmember Group1 | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Step3: Get-DistributionGroupmember Group3 | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Step4: Get-DistributionGroupmember Group5 | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
It will be a lot of work if there are too many nested groups.
Best Regards.
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com
Lynn-Li
TechNet Community Support- Marked as answer by Lynn-LiModerator Monday, February 15, 2016 2:21 AM
Friday, January 22, 2016 7:11 AMModerator
All replies
-
Not sure on 1st query.
2nd Query you can do it via below shell command
$a = gc "distributiongroup.txt"
$a | set-DistributionGroup | {$_.RequireSenderAuthenticationEnabled -eq $false}
Regards, Krselva. Please remember to mark the replies as answers if its helps you, and unmark the answers if it is not help you.
Thursday, January 21, 2016 11:54 PM -
Hi,
No easy one command to get all nested groups in one main group (It's easy for nested members in one group). Here is my suggested procedure.
Run this command on main group to get the groups in the main group and uncheck sender authenticaiton at the same time.
Get-DistributionGroupmember MainGroup | ?{$_.RecipientTypeDetails -like "*group*"} | Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Then replace Maingroup to the group in the result of the command above. Do the same on layer down until the last layer.
Example:
Step1: Get-DistributionGroupmember MainGroup | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Step2: Get-DistributionGroupmember Group1 | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Step3: Get-DistributionGroupmember Group3 | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
Step4: Get-DistributionGroupmember Group5 | ?{$_.RecipientTypeDetails -like "*group*"}| Set-DistributionGroup -RequireSenderAuthenticationEnabled $false
It will be a lot of work if there are too many nested groups.
Best Regards.
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com
Lynn-Li
TechNet Community Support- Marked as answer by Lynn-LiModerator Monday, February 15, 2016 2:21 AM
Friday, January 22, 2016 7:11 AMModerator