Connect to Exchange Online PowerShell with Connect-ExchangeOnline cmdlet and a service principal with client secret
Connecting to Azure with a service principal with client secret is quite simple - you can get the credentials and pass them to the Connect-AzAccount cmdlet and specify the -ServicePrincipal parameter. $credential = Get-Credential Connect-AzAccount -Credential $credential -TenantId " your-tenant-identifier " -ServicePrincipal Connecting to Exchange Online however is somewhat more problematic - there is no "ServicePrincipal" parameter and using the cmdlet with just a credential and organization shows the following error. The user is not recognized as a managed user, or a federated user.Azure AD was not able to identify the IdP that needs to process the user U/P: Wrong username It looks like Microsoft haven't implemented the ability to use client secrets as they're not as secure as certificates (and the Connect-ExchangeOnline cmdlet has good support for certficiates). Microsoft doesn't appear to have implemented any of their online services with a