Troubleshooting Exchange Online EXOv3 – Module Could Not Be Correctly Formed
10 min
issue when connecting to exchange online using the exchange online powershell v3 (exov3) module with app only authentication, the following error may occur module could not be correctly formed please run connect exchangeonline again 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 exchange manageasappv2 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 exchange manageasappv2 2\ add the correct api permission add exchange manageasapp ensure the required admin consent has been granted after changing the api permission incorrect api permission exchange manageasappv2 screenshot incorrect api permission configuration correct api permission exchange manageasapp screenshot correct api permission configuration error example when the incorrect permission is configured, running connect exchangeonline may return an error similar to ps> connect exchangeonline appid \[redacted] organization '\[redacted] onmicrosoft com' certificatethumbprint \[redacted] module could not be correctly formed please run connect exchangeonline again at c \program files\windowspowershell\modules\exchangeonlinemanagement\3 6 0\netframework\exchangeonlinemanagement psm1 766 char 21 \+ throw $ exception; \+ \+ categoryinfo notspecified ( ) \[], parentcontainserrorrecordexception \+ fullyqualifiederrorid runtimeexception verification after updating the app registration to use exchange manageasapp and granting admin consent, run the connection command again connect exchangeonline appid \[app id] organization '\[tenant] onmicrosoft com' certificatethumbprint \[certificate thumbprint] the exchange online connection should now complete without the module could not be correctly formed error