Forum Discussion

colonel_claypoo's avatar
colonel_claypoo
Iron Contributor
Aug 16, 2024

Connect-ExchangeOnline - Unauthorized

I've been searching for a solution for this error message for a couple of days now - to no avail.

Connect-ExchangeOnline through certificate always throws 'Unauthorized'.

UnAuthorized At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.5.1\netFramework\ExchangeOnlineManagement.psm1:766 char:21

$tenant = '' $appId = '' $thumbprint = '' Connect-ExchangeOnline -CertificateThumbprint $thumbprint -AppId $appId -Organization $tenant

I tried:

  • multiple machines
  • certs in Cert:\CurrentUser\my\ and Cert:\LocalMachine\my\
  • Certs are installed in the Azure AD App
  • multiple networks
  • PS 5.1 and 7.2
  • ExchangeOnlineManagement Module versions 3.4.0 through 3.5.1

And I tried the following Graph API permissions:

As mentioned Exchange.ManageAsApp API permission does not exist any longer hence the issue.

Has anyone figured it out yet?

6 Replies

Resources