Symptoms

When you scan an Exchange Online organization using the Microsoft Exchange Organization agent, you see the following error

Error executing PowerShell command 'Connect-ExchangeOnline'. UnAuthorized


Cause

This can occur when the service principal has not been configured correctly in Exchange Online.


Resolution

Follow the steps in the Service Principal (Certificate) section.