Table of Contents
Outlook 365 – How to solve “something went wrong and Outlook couldn’t set up your account” when connecting to an Exchange Online accounts with custom domain?
While MFA can be re-activated for the user afterward, it is a workaround, not a solution. Searching on the web and the official thread from Microsoft support forum return no good solution for the issue. Most suggest we need to turn on modern authentication – which is the case if using version of Outlook 2016 below – but we don’t think it would be an issue for Outlook 365. Some suggest the autodiscover of the domain was not set properly, but if that’s true, it won’t work even if MFA was turned off.
Until one day we stumbled across the solution: enabling organisation wide setting OAuth2ClientProfileEnabled using Powershell. It a setting only accessible using PowerShell. The setting was false by default, all we need is to set it to true.
- You should use PowerShell on Windows 10 or Windows 11. Be aware that you need to install .NET Framework 4.5 or later.
- An internet connection is required. TCP port 80 must be opened to connect from your local machine to the destination host.
- Access to Exchange Online PowerShell must be enabled for the current user (by default such access is enabled for administrators).
Connect to Exchange Online PowerShell
1. Right click on Windows icon then select Windows PowerShell Admin. In Windows 11, select Windows Terminal Admin instead of Windows PowerShell Admin.
2. Copy then paste all bellow commands into PowerShell window at once then hit Enter to install and Connect to Exchange Online PowerShell.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force; Install-PackageProvider -Name NuGet -Force; Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted; Install-Module -Name ExchangeOnlineManagement; Import-Module ExchangeOnlineManagement; Connect-ExchangeOnline;
Run bellow command to enable OAuth2ClientProfile.
PS C:\WINDOWS\system32> Get-OrganizationConfig | Select-Object OAuth2ClientProfileEnabled OAuth2ClientProfileEnabled -------------------------- True