What this guide covers: Enabling Hybrid Modern Authentication (HMA) shifts authentication for on-premises Exchange mailboxes from Active Directory to Entra ID, unlocking MFA, Conditional Access, and passwordless sign-in without moving a single mailbox to the cloud. The core implementation is two PowerShell commands, but there are prerequisites that can take time to get right. This guide walks through every step in order, including a dedicated section for organizations that use ADFS on-premises as their identity provider.

What Is Hybrid Modern Authentication and Why Enable It?

In a standard on-premises Exchange Server deployment, Exchange handles authentication itself by talking to Active Directory. Clients send credentials, Exchange validates them against AD, and access is granted. This works, but it is inherently limited to whatever authentication methods Active Directory and Exchange natively support, which means no MFA, no Conditional Access, and no modern identity controls without third-party add-ons.

Hybrid Modern Authentication changes this by making Entra ID (Azure AD) the identity provider for on-premises Exchange. When a client connects, Exchange instructs it to authenticate against Azure AD's EvoSTS endpoint. Azure AD issues an OAuth 2.0 bearer token, which the client then presents to Exchange. Exchange validates the token cryptographically rather than checking a password. From that point, any capability that Azure AD has, MFA, Conditional Access, passwordless FIDO2 keys, sign-in risk policies, applies equally to on-premises Exchange mailboxes.

The practical benefits:

Where HMA sits in the hybrid stack: HMA is independent from mailbox migration. You do not need to move any mailboxes to Exchange Online to benefit from it. You do need a hybrid relationship (Hybrid Configuration Wizard) to have been run, because it creates the OAuth trust objects that HMA relies on.

Prerequisites Checklist

Before running a single command, verify every item below. Some may already be in place if you have an existing Exchange hybrid deployment.

Step 1: Inventory Your Exchange URLs

Step 1 of 5

Azure AD needs to know which URLs belong to your Exchange organization so it can issue tokens for them. You must collect the internal and external URLs for every virtual directory across every Exchange server in your organization. In a multi-site environment, you may have several distinct URLs per service.

Run these commands from the Exchange Management Shell. Run them on each Exchange server or use the -ADPropertiesOnly switch to query all servers at once:

# Collect all Exchange virtual directory URLs
Get-MapiVirtualDirectory -ADPropertiesOnly | FL Server, InternalUrl, ExternalUrl
Get-WebServicesVirtualDirectory -ADPropertiesOnly | FL Server, InternalUrl, ExternalUrl
Get-OABVirtualDirectory -ADPropertiesOnly | FL Server, InternalUrl, ExternalUrl
Get-ActiveSyncVirtualDirectory -ADPropertiesOnly | FL Server, InternalUrl, ExternalUrl
Get-AutoDiscoverVirtualDirectory -ADPropertiesOnly | FL Server, InternalUrl, ExternalUrl
# Also capture the AutoDiscover SCP (service connection point)
Get-ClientAccessService | FL Name, AutoDiscoverServiceInternalUri

Write down every unique hostname that appears. For most organizations, this will be a single namespace (e.g., mail.contoso.com and autodiscover.contoso.com). Multi-site organizations may have several, mail-us.contoso.com, mail-uk.contoso.com, etc. You will need all of them in Step 2.

Note: Only collect the hostnames that are actively in use and publicly resolvable. Internal-only URLs (e.g., server01.corp.contoso.com) do not need to be registered with Azure AD if external clients never use them, but if your internal and external URLs are the same hostname, which is best practice, they are already covered.

Step 2: Register Exchange URLs as Azure AD Service Principal Names

Step 2 of 5

Azure AD has a service principal representing Exchange Online (AppId 00000002-0000-0ff1-ce00-000000000000). For HMA to work, your on-premises Exchange URLs must be added to that service principal's ServicePrincipalNames list. This tells Azure AD that tokens requested for those URLs are legitimate Exchange authentication requests.

Connect to MSOnline PowerShell and run the following. Add one line per unique URL collected in Step 1:

# Connect to MSOnline if not already connected
Connect-MsolService

# Retrieve the Exchange Online service principal
$sp = Get-MsolServicePrincipal -AppPrincipalId "00000002-0000-0ff1-ce00-000000000000"

# View the current list (do not lose these -- you are ADDING to them, not replacing)
$sp.ServicePrincipalNames

# Add your Exchange on-premises URLs (one line per URL)
$sp.ServicePrincipalNames += "https://mail.contoso.com/"
$sp.ServicePrincipalNames += "https://autodiscover.contoso.com/"

# Commit the updated list
Set-MsolServicePrincipal -AppPrincipalId "00000002-0000-0ff1-ce00-000000000000" `
    -ServicePrincipalNames $sp.ServicePrincipalNames

# Verify the new entries are present
(Get-MsolServicePrincipal -AppPrincipalId "00000002-0000-0ff1-ce00-000000000000").ServicePrincipalNames

Do not overwrite the existing list. The service principal already contains entries for all Exchange Online URLs. If you assign a new array rather than appending to the existing one, you will break Exchange Online authentication for your entire tenant. Always retrieve the current list first and add to it.

MSOnline module deprecation: The MSOnline module (Connect-MsolService) is being retired by Microsoft. The equivalent using the Microsoft Graph PowerShell SDK is:

$sp = Get-MgServicePrincipal -Filter "AppId eq '00000002-0000-0ff1-ce00-000000000000'"
$spns = $sp.ServicePrincipalNames + "https://mail.contoso.com/"
Update-MgServicePrincipal -ServicePrincipalId $sp.Id -ServicePrincipalNames $spns

Step 3: Verify OAuth on All Virtual Directories

Step 3 of 5

All virtual directories must have OAuth authentication enabled. The Hybrid Configuration Wizard sets this by default, so this step is usually a verification rather than a change. Run this from the Exchange Management Shell:

# Verify OAuth is enabled on all virtual directories
Get-MapiVirtualDirectory | FL Server, IISAuthenticationMethods, InternalAuthenticationMethods, ExternalAuthenticationMethods
Get-WebServicesVirtualDirectory | FL Server, OAuthAuthentication
Get-OABVirtualDirectory | FL Server, OAuthAuthentication
Get-AutoDiscoverVirtualDirectory | FL Server, OAuthAuthentication

For the MAPI virtual directory, you should see OAuth in the IISAuthenticationMethods list. For EWS, OAB, and AutoDiscover, OAuthAuthentication should be True. If any are False, set them manually:

# Example: re-enable OAuth on EWS if it was disabled
Set-WebServicesVirtualDirectory -Identity "EXCH01\EWS (Default Web Site)" -OAuthAuthentication $True

# Run for each virtual directory type and each server where it is False

Step 4: Enable HMA: The Two PowerShell Commands

Step 4 of 5

With the prerequisites verified and Azure AD updated, enabling HMA comes down to two Exchange Management Shell commands. These are organization-wide settings, they affect all users and all clients simultaneously.

# Command 1: Set EvoSTS as the default authorization endpoint
# EvoSTS is Azure AD's token-issuing endpoint for Exchange authentication
$evoSts = Get-AuthServer | Where-Object {$_.Name -like "EvoSts*"}
Set-AuthServer -Identity $evoSts.Name -IsDefaultAuthorizationEndpoint $True

# Command 2: Enable OAuth2 client profile (turns HMA on)
Set-OrganizationConfig -OAuth2ClientProfileEnabled $True

Multi-tenant environments: If your Exchange organization is connected to more than one Entra ID tenant, there will be one EvoSTS entry per tenant. Only one can have IsDefaultAuthorizationEndpoint = True at a time. Setting it on a second tenant will automatically unset it on the first. Confirm which tenant you are enabling HMA against before running Command 1.

To reverse HMA and return to legacy authentication, run:

Set-OrganizationConfig -OAuth2ClientProfileEnabled $False

Because it is a single command to revert, it is safe to enable HMA during a maintenance window, test it, and roll back if needed before the window closes.

What happens on the client after enabling

Existing connected Outlook clients will not immediately switch. A client that already has an authenticated session will keep using it until the token expires or the client reconnects from scratch (usually within 24–48 hours, or on the next reboot). To force an immediate switch for testing, either reboot the test machine or add a new Outlook profile. You can tell which protocol a client is using by holding Ctrl and right-clicking the Outlook system tray icon, then choosing Connection Status. The Authn column will show Bearer for a modern auth session and Nego or Basic for a legacy session.

Step 5: Test and Validate

Step 5 of 5

Use the Test-OAuthConnectivity cmdlet from the Exchange Management Shell to confirm that the on-premises Exchange server can successfully obtain and validate tokens from Azure AD:

# Test OAuth connectivity from Exchange on-premises to Exchange Online
Test-OAuthConnectivity -Service EWS `
    -TargetUri "https://outlook.office365.com/ews/exchange.asmx" `
    -Mailbox "testuser@contoso.com" `
    -Verbose | Format-List

A successful result shows ResultType: Success. Errors here typically point to a misconfigured OAuth configuration, an incorrect EvoSTS entry, or clock skew between Exchange and the domain controllers.

Microsoft also provides a validation script, Test-HMAEAS.ps1, available from the Microsoft documentation, which tests the full Outlook Mobile flow including AutoDetect and AutoDiscover V2 resolution. This is particularly useful if Outlook Mobile connections are failing after enabling HMA.

# Verify the org config setting is active
Get-OrganizationConfig | FL OAuth2ClientProfileEnabled, MapiHttpEnabled

# Confirm EvoSTS is the default endpoint
Get-AuthServer | Where-Object {$_.Name -like "EvoSts*"} | FL Name, IsDefaultAuthorizationEndpoint, Enabled

Using ADFS as Your On-Premises Identity Provider

If your organization uses Active Directory Federation Services (ADFS) on-premises as the identity provider, meaning your Entra ID tenant's domain is federated rather than managed, HMA will work without any additional configuration on the Exchange side. The critical thing to understand is that from Exchange's perspective, it always points to Azure AD (EvoSTS). It never points directly to ADFS. Azure AD handles the redirect to ADFS automatically when it sees a sign-in request from a federated domain.

How the authentication flow changes with ADFS

1
Outlook (or another client) connects to Exchange on-premises and requests access to a mailbox.
↓
2
Exchange responds with an OAuth challenge, directing the client to authenticate against the EvoSTS endpoint (Azure AD).
↓
3
The client sends an authentication request to Azure AD for the user's UPN (e.g., user@contoso.com).
↓
4
Azure AD looks up the domain and sees it is federated. It redirects the client to the ADFS WS-Federation endpoint (https://adfs.contoso.com/adfs/ls/).
↓
5
The client authenticates to ADFS. On the internal network, ADFS typically uses Integrated Windows Authentication (Kerberos), meaning no prompt appears. External clients authenticate through the Web Application Proxy to ADFS using forms authentication or another configured method, where MFA can be enforced.
↓
6
ADFS issues a SAML assertion to Azure AD, confirming the user's identity and claims.
↓
7
Azure AD converts the SAML assertion into an OAuth 2.0 bearer token and returns it to the client.
↓
8
The client presents the OAuth bearer token to Exchange on-premises. Exchange validates the token cryptographically against EvoSTS metadata and grants access.

The key principle: The Exchange on-premises HMA configuration is identical whether you use managed domains (PHS/PTA) or federated domains (ADFS). The EvoSTS auth server points to Azure AD in both cases. You do not configure Exchange to talk to ADFS directly, that routing happens inside Azure AD.

ADFS prerequisites for HMA

Before enabling HMA, confirm the following ADFS-specific requirements are met:

Verify the ADFS federation relationship

Run these checks from an ADFS server to confirm the federation with Azure AD is intact before enabling HMA:

# Check the Azure AD relying party trust exists
Get-AdfsRelyingPartyTrust -Identifier "urn:federation:MicrosoftOnline" | FL Name, Enabled, IssuanceAuthorizationRules

# Check token signing certificate validity
Get-AdfsCertificate -CertificateType Token-Signing | FL CertificateType, Thumbprint, NotAfter, AutoRollover

# Confirm OAuth endpoints are enabled
Get-AdfsEndpoint | Where-Object {$_.Protocol -eq "OAuth"} | FL AddressPath, Protocol, Enabled, Proxy

# Run the built-in ADFS health check
Test-AdfsServerHealth

# From Azure AD (MSOnline) -- verify federation metadata for the domain
Get-MsolFederationProperty -DomainName "contoso.com"
Get-MsolDomain | FL Name, Authentication, Status

Claims rules for Exchange HMA with ADFS

The Azure AD relying party trust in ADFS must issue the claims that Azure AD expects when validating a federated sign-in. If you ran HCW or set up ADFS federation using the standard Microsoft documentation, these rules should already be in place. Confirm the following claims are being issued by running Get-AdfsRelyingPartyTrust -Identifier "urn:federation:MicrosoftOnline" | Select -ExpandProperty IssuanceTransformRules:

Missing or malformed claims rules are the second most common cause of ADFS-related HMA failures after expired token signing certificates. If users are redirected to ADFS, authenticate successfully, but then receive an error from Azure AD, claims rules are the first thing to check.

Web Application Proxy for external clients

When a client is outside the corporate network, it cannot reach the internal ADFS farm directly. WAP servers in the DMZ proxy the authentication request inbound to ADFS and return the response. For HMA with ADFS to work for external clients:

# On a WAP server -- verify published applications
Get-WebApplicationProxyApplication | FL Name, ExternalUrl, BackendServerUrl, ExternalCertificateThumbprint

Seamless SSO and ADFS: With ADFS as your IDP, domain-joined internal clients get Integrated Windows Authentication (Kerberos) to ADFS, meaning no sign-in prompt at all on the corporate network. This is native ADFS behavior. The Entra ID Seamless SSO feature (which uses a different Kerberos ticket mechanism) is not needed and does not apply when ADFS is the IDP.

ADFS-specific troubleshooting

If HMA is enabled but users on federated domains cannot authenticate, work through these in order:

What HMA Does Not Change: OWA and ECP

Enabling Hybrid Modern Authentication has no effect on Outlook on the Web (OWA) or Exchange Control Panel (ECP). These browser-based interfaces continue to use forms-based authentication regardless of HMA status. This is intentional and has a practical benefit: if cloud connectivity to Azure AD is disrupted, users can still access their mailboxes via OWA even though Outlook Desktop and Outlook Mobile would fail to authenticate.

If you want to bring OWA under modern, token-based authentication, for example, to enforce MFA on browser access to on-premises mailboxes, you have two options that are configured separately from HMA:

Both approaches are separate projects from HMA and are documented in Microsoft's Exchange hybrid documentation.

Post-Enablement: Blocking Basic Authentication (Exchange 2019)

Once HMA is enabled and confirmed working, Exchange Server 2019 allows you to block basic authentication entirely using authentication policies. This is not available on Exchange 2016 or earlier, on those versions, you can limit basic auth but not block it outright.

Before blocking basic auth, identify any clients still using it. Outlook Mobile is the most likely source of lingering basic auth sessions, profiles created before HMA was enabled will continue using basic auth until the profile is deleted and recreated. You can check for basic auth ActiveSync connections with:

# Find ActiveSync devices still using basic authentication
Get-MobileDeviceStatistics -Mailbox "user@contoso.com" | FL DeviceFriendlyName, ClientType, LastSyncAttemptTime

# ClientType "OutlookService" = modern auth (correct)
# ClientType "Outlook for iOS and Android" = basic auth profile (needs to be recreated)

Once you have confirmed no remaining basic auth clients, block it with an authentication policy:

# Create a policy that blocks all basic authentication protocols
New-AuthenticationPolicy -Name "Block Basic Auth" `
    -BlockLegacyAuthActiveSync `
    -BlockLegacyAuthAutodiscover `
    -BlockLegacyAuthImap `
    -BlockLegacyAuthMapi `
    -BlockLegacyAuthOfflineAddressBook `
    -BlockLegacyAuthOutlookService `
    -BlockLegacyAuthPop `
    -BlockLegacyAuthSmtp `
    -BlockLegacyAuthWebServices

# Apply org-wide
Set-OrganizationConfig -DefaultAuthenticationPolicy "Block Basic Auth"

Troubleshooting Common Issues

Outlook connects but Authn column still shows Nego or Basic

The existing session is being reused. Restart Outlook after rebooting the machine, or create a new Outlook profile. The client will not switch protocols mid-session.

Outlook prompts for credentials repeatedly after enabling HMA

Check that the EnableADAL registry key is set correctly. On Outlook 2013: HKCU\Software\Microsoft\Office\15.0\Common\Identity\EnableADAL = 1. On Outlook 2016 and later: ensure EnableADAL is not set to 0, remove the value if it exists. A value of 0 disables modern auth in Outlook regardless of server configuration.

Outlook Mobile fails to configure a new profile after HMA is enabled

This is usually AutoDetect or AutoDiscover V2 not resolving correctly. AutoDiscover V2 (used by Outlook Mobile's AutoDetect service to locate the mailbox) is not site-aware and may return URLs that are not reachable from the phone. Run the Test-HMAEAS.ps1 validation script. Ensure that your AutoDiscover endpoint is externally reachable and that the load balancer is presenting the full certificate chain.

Test-OAuthConnectivity returns an error

Common causes: the EvoSTS auth server is not set as the default authorization endpoint, the OAuth configuration was not properly established by HCW (re-run HCW to refresh it), or there is a clock skew greater than 5 minutes between the Exchange server and the domain controller handling time sync. Run Get-AuthConfig | FL CurrentCertificateThumbprint and confirm the OAuth certificate is present and not expired.

Conditional Access policies unexpectedly apply to on-premises mailboxes

This is by design. In Entra ID, Exchange Server and Exchange Online are the same application (Office 365 Exchange Online). Any Conditional Access policy that targets this application or uses "All cloud apps" applies to HMA-enabled Exchange on-premises as well. If you had an existing policy requiring MFA for Exchange Online and you enable HMA, that policy immediately applies to on-premises mailboxes too. Review your Conditional Access policies before enabling HMA and plan accordingly, for example, by scoping existing policies to a group containing only cloud mailbox users.

Exchange Server Modern Authentication HMA ADFS OAuth Hybrid Conditional Access EvoSTS