Basic authentication is needed for PowerShell operations to create the objects (Shared, Room and equipment mailboxes and distribution lists) and apply mailbox permissions in the Office 365 tenant.
These are the steps to enable basic authentication for the Office 365 service account:
These are the steps to enable basic authentication for the Office 365 service account:
- 1- Connect to Exchange Online Connect-ExchangeOnline
- 2- Create a new Authentication Policy called “AllowBasicAuth” New-AuthenticationPolicy -Name "AllowBasicAuth"
- 3- Set the attribute “AllowBasicAuthPowershell” of this Authentication Policy to true. Set-AuthenticationPolicy -Identity "AllowBasicAuth" -AllowBasicAuthPowershell:$true
- 4- Add the Office 365 service account to this Authentication Policy Set-User -Identity admin@domain.com -AuthenticationPolicy "AllowBasicAuth"
- 5- By default, when you create or change the authentication policy assignment on users or update the policy in O365, the changes can take up to 24 hours to replicate it the tenant. If you want the policy to take effect within 30 minutes: Set-User -Identity "admin@domain.com" -STSRefreshTokensValidFrom $([System.DateTime]::UtcNow)
For more information you can check this article from Microsoft: