Troubleshooting Exchange Online EXOv3 – Module Could Not Be Correctly Formed
Issue
When connecting to Exchange Online using the Exchange Online PowerShell V3 (EXOv3) module with app-only authentication, the following error may occur:
This can occur when the Azure App Registration has been configured with the incorrect Exchange Online API permission.
Cause
The App Registration is configured with the following API permission:
This permission is incorrect for this configuration and prevents EXOv3 from successfully establishing the Exchange Online connection.
Resolution
Update the API permissions assigned to the App Registration.
1. Remove the incorrect API permission
Remove:
2. Add the correct API permission
Add:
Ensure the required admin consent has been granted after changing the API permission.
Incorrect API Permission
Screenshot: Incorrect API permission configuration
Correct API Permission
Screenshot: Correct API permission configuration
Error Example
When the incorrect permission is configured, running Connect-ExchangeOnline may return an error similar to:
Verification
After updating the App Registration to use Exchange.ManageAsApp and granting admin consent, run the connection command again:
The Exchange Online connection should now complete without the Module could not be correctly formed error.