Forum Discussion
Connect-ExchangeOnline - Unauthorized
Other than that, check the certificate validity.
VasilMichev Yes, that used to work. But to me it seems Exchange.ManageAsApp does not exist any longer.
Would you be so kind and check on your end if the API is still available?
Thanks.
- VasilMichevAug 19, 2024MVPThe API is still there, you're using the wrong search query. Follow the instructions in the article above.
- colonel_claypooAug 20, 2024Iron Contributor
Oh yeah, that's right. Now one step further. I'm getting this error upon connecting:
Connect-ExchangeOnline -CertificateThumbprint $thumbprint -AppId
$appId -ShowBanner:$false -Organization $tenant -Verbose
VERBOSE: Returning precomputed version info: 3.4.0
VERBOSE: ModuleVersion: 3.4.0
VERBOSE: [ThreadID: #] Trying to get a new token from AAD
VERBOSE: [ThreadID: #] Trying to acquire token based on UI flow
VERBOSE: [ThreadID: #] Successfully acquired new token for Cert based flow.
VERBOSE: [ThreadID: #] Successfully got a token from AAD
VERBOSE: ConnectionContext Removed
OperationStopped: The role assigned to application 6eb9890f-dbeb-4e6d-b2fb-2e4c698fa7c0 isn't supported in this scenario. Please check online documentation for assigning correct Directory Roles to Azure AD Application for EXO App-Only Authentication.If the cert was wrong i.e. not match between Windows and Azure cert stores the error would read:
Do you have an idea? Thank you.- VasilMichevAug 20, 2024MVPYou need to assign a role such as Exchange Admin or Exchange Recipient admin.., the next step in the documentation...