Office 365 Modern Authentication & 2FA
The problem
When enabling 2FA O365 admins cannot login to Office Desktop unless Modern Authentication is enabled. This is my destillation of the linked documentation.
Enable modern auth in Exchange Online
Connect to Exchange Online Powershell with 2FA
If you don’t have it check next section about installation.
Connect-EXOPSSession -UserPrincipalName [email protected]
# (German and Govt users need to check doc for more config)
Set-OrganizationConfig -OAuth2ClientProfileEnabled $true
Get-OrganizationConfig | Format-Table Name,OAuth* -Auto
# Confirm that everything is golden and logout
Get-PSSession | Remove-PSSession
Done!
Reboot!
Install / Enable Exchange Powershell
Doc on connecting to Exchange online using multi-factor authentication
Does not work on PS core. (2019-12)
- Use Explorer. Not Edge or anything else.
- Office Admin > Exchange > Hybrid > Setup > Configure
- Complete the installation
Make sure that the Windows Remote Management service is running, gui or from code below.
- open COMMAND PROMPT as Administrator and execute
net start win-rm
winrm get winrm/config/client/auth
# make sure Basic = true or else run next line
# winrm set winrm/config/client/auth @{Basic="true"}