Wednesday, 24 May 2017

How to allow external sender for Office 365 Groups using Powershell

Office 365 Group is a back end service for Microsoft Teams, Planner, and etc. By default Office 365 Groups are not configured to receive external messages either it is public or private group. But most of organizations using Teams, Planner and even standalone Office 365 Groups for external collaboration and conversation, so receiving mails from external domain users is inevitable.

We can use the Exchange Online Powershell cmdlet Set-UnifiedGroup to set the people outside the organization to send mail to a specific group. Before proceed, Connect Exchange Online Powershell module and use the following command to allow external sender.
Set-UnifiedGroup <group> -RequireSenderAuthenticationEnabled $false
Actually we need to set the attribute RequireSenderAuthenticationEnabled as false to remove the authentication check of external senders. You can use the below command if you want set this property for all the Office 365 Groups.
Get-UnifiedGroup | Set-UnifiedGroup -RequireSenderAuthenticationEnabled $false
You can use below command if you want allow guest users only for all public groups:
Get-UnifiedGroup | Where-Object {$_.AccessType -eq 'Public'} | Set-UnifiedGroup -RequireSenderAuthenticationEnabled $false
We can list all the groups with external sender access property using below powershell:
Get-UnifiedGroup | Select Alias,AccessType,RequireSenderAuthenticationEnabled
The below command lists only office 365 groups with guest sender access enabled.
Get-UnifiedGroup | Where-Object {$_.RequireSenderAuthenticationEnabled -eq $false} | Select Alias,RequireSenderAuthenticationEnabled
You can also enable via UI using Office 365 Admin center: Office 365 Portal -> Peoples -> Edit Group and set the option "Let people outside the organization email the group"

allow guest sender access for Office 365 Groups