Preventing external senders from emailing internal Office 365 groups
You must be a global admin to perform these steps.
How to do it…
-Identity parameter with the display name of the group you wish to change, and then run the following code snippet:
Set-UnifiedGroup -Identity "Test" -RequireSenderAuthenticationEnabled $true
How it works…
You've just protected an Office 365 group's inbox from unwanted external emails. Setting the
-RequireSenderAuthenticationEnabled property on a group allows only internal users to send an email to that group. If external users send a message to the group's email address, that message will be rejected. Internal users are still able to send externally, unless other restrictions are put in place.