Exchange ServerDeep dive

Exchange modern hybrid and the Hybrid Agent: when to use it and how to troubleshoot it

What the Exchange Hybrid Agent replaces, what still needs inbound access or classic hybrid, and how to check agent health, redundancy and the msappproxy.net endpoint.

Classic Exchange hybrid needs Exchange Online to reach your on-premises EWS endpoint from the internet. Modern hybrid topology replaces that inbound path with the Microsoft Hybrid Agent, which only makes outbound connections. In this post I'll explain what the agent carries and what it doesn't, when modern hybrid is the right choice, and how to troubleshoot the agent when free/busy or mailbox moves stop working.

How this guide is organised: How it works → Classic vs modern → When to choose modern hybrid → Step-by-step → Troubleshooting the agent → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. Classic vs modern. 3. When to choose modern hybrid. 4. Step-by-step (3 steps: Prepare the agent server; Run HCW on the agent server; Remove the single points of failure). 5. Troubleshooting the agent. 6. Verify. 7. Tips and gotchas. Toolbox: Get-HybridAgent, Update-HybridApplication, Test-HybridConnectivity, RemoteServer, TargetSharingEpr.1How it works2Classic vs modern3When to choosemodern hybrid4Step-by-step1Prepare the agent server2Run HCW on the agentserver3Remove the single pointsof failure5Troubleshooting theagent6Verify7Tips and gotchasTOOLBOXGet-HybridAgentUpdate-HybridApplicationTest-HybridConnectivityRemoteServerTargetSharingEprHow this guide is organised: How it works → Classic vs modern → When to choose modern hybrid → Step-by-step → Troubleshooting the agent → Verify → Tips and gotchasFlow diagram of the article's sections in reading order: 1. How it works. 2. Classic vs modern. 3. When to choose modern hybrid. 4. Step-by-step (3 steps: Prepare the agent server; Run HCW on the agent server; Remove the single points of failure). 5. Troubleshooting the agent. 6. Verify. 7. Tips and gotchas. Toolbox: Get-HybridAgent, Update-HybridApplication, Test-HybridConnectivity, RemoteServer, TargetSharingEpr.1How it works2Classic vs modern3When to choose modern hybrid4Step-by-step1Prepare the agent server2Run HCW on the agent server3Remove the single points of failure5Troubleshooting the agent6Verify7Tips and gotchasTOOLBOXGet-HybridAgentUpdate-HybridApplicationTest-HybridConnectivityRemoteServerTargetSharingEpr
At a glance: how this guide is organised · 3 steps · 5 key settings and tools

Note: Exchange Server 2016 and 2019 reached end of support on 14 October 2025, so the on-premises side of a hybrid should now run Exchange Server Subscription Edition (SE). You can install the agent on an Exchange Mailbox server or on a separate domain-joined "agent server".

How it works#

The agent uses the same technology as Microsoft Entra application proxy. If you choose Use Exchange Modern Hybrid Topology in the Hybrid Configuration Wizard (HCW), the wizard installs the agent (the Microsoft Hybrid Service, mshybridsvc), registers it in Microsoft Entra ID and creates a unique endpoint, <GUID>.resource.mailboxmigration.his.msappproxy.net. It then points Exchange Online at that URL in two places:

  • the RemoteServer of the hybrid migration endpoint, which mailbox moves use;
  • TargetSharingEpr on the organization relationship and/or IntraOrganization connector, which free/busy lookups from Exchange Online use.

Requests to that URL travel down the agent's outbound connection to the internal FQDN of the Exchange server you picked in HCW. Free/busy in the other direction, when on-premises users look up cloud mailboxes, never touches the agent: your Mailbox servers call Microsoft 365 directly over TCP 443.

Classic vs modern: what actually changes#

CapabilityClassic topologyModern topology (Hybrid Agent)
Free/busy, cloud to on-premisesInbound HTTPS to published EWS/AutodiscoverThrough the agent, with no inbound rule
Mailbox moves (MRS)Inbound HTTPS to EWS with MRS ProxyThrough the agent; one migration endpoint with default limits
Mail flow (SMTP)Connectors on TCP 25 with a public certificateNo change: SMTP never uses the agent
Hybrid Modern AuthenticationSupportedNot supported
Message tracking, multi-mailbox searchSupportedRequires classic (EWS and Autodiscover published)
Teams calendar for on-premises mailboxesSupportedMicrosoft recommends classic
GCC, GCC High, GallatinSupportedNot supported

Modern hybrid doesn't remove every inbound requirement. Exchange Online still delivers mail to your on-premises hybrid endpoint over SMTP, and users who reach on-premises mailboxes from outside still need your normal client publishing. Publishing OWA or ECP through Microsoft Entra application proxy isn't supported.

When to choose modern hybrid#

It's a good fit when you can't publish EWS to the internet, the hybrid exists mainly to move mailboxes and share free/busy, and you have a single Exchange organization. It's a poor fit if you need HMA (for example, Outlook mobile against on-premises mailboxes), Teams calendar access to on-premises mailboxes, cross-premises search, several Exchange organizations or several migration endpoints. If classic hybrid already works, Microsoft recommends switching only when you're blocked from migrating. Switching means deleting the existing migration batches and the migration endpoint in Exchange Online, then rerunning HCW.

Step-by-step: deploy it with redundancy#

1. Prepare the agent server#

  • Domain-joined Windows Server (the documented list runs from 2012 R2 to 2022), .NET Framework 4.7.2 or later and TLS 1.2. The installing account needs Organization Management plus local administrator rights.
  • Outbound TCP 80 and 443 to the internet, and TCP 80, 443, 5985 and 5986 to the Exchange server you'll select in HCW.
  • Proxies must be unauthenticated. After installation, run .\ConfigureOutBoundProxy.ps1 -ProxyAddress http://proxy:8080 from C:\Program Files\Microsoft Hybrid Service.
  • Optionally, import the HybridManagement.psm1 sample script linked from Microsoft's Hybrid Agent page and run Test-HybridConnectivity -TestO365Endpoints to confirm the required endpoints are reachable.
  • Enable MRS Proxy on each Mailbox server before you run HCW:
PowerShell
Set-WebServicesVirtualDirectory -Identity "EX01\EWS (Default Web Site)" -MRSProxyEnabled $true

2. Run HCW on the agent server#

Run HCW on the computer that should host the agent, pick Full or Minimal, then select Use Exchange Modern Hybrid Topology. Downloading, installing, registering and testing the agent can take up to 10 minutes. The remaining pages, including the mail flow connectors and the SMTP certificate, are the same as in classic hybrid.

3. Remove the single points of failure#

Rerun HCW on a second server and choose Install an additional agent. Also note that the agent registers one Exchange server's internal FQDN: if that server goes offline, free/busy and moves stop. Point the registration at your load-balanced namespace instead. The AppId is the GUID in your msappproxy.net URL, not the agent ID:

PowerShell
Set-Location "C:\Program Files\Microsoft Hybrid Service"
Import-Module .\HybridManagement.psm1
Get-HybridAgent -UserPrincipalName admin@contoso.onmicrosoft.com
Update-HybridApplication -AppId "<endpoint GUID>" -TargetUri "https://mail.contoso.com" `
    -UserPrincipalName admin@contoso.onmicrosoft.com

Troubleshooting the agent#

SymptomWhere to look
Cloud users see no free/busy for on-premises users, and moves can't connectmshybridsvc running on at least one agent; Get-HybridAgent output; registered Exchange server or load balancer reachable from the agent
HCW fails while installing or registering the agentThe outbound proxy: a proxy that blocks registration breaks installation and the connectivity test, so let the agent bypass it until it's configured
On-premises users can't see cloud free/busyNot the agent. Check outbound 443 from the Mailbox servers and Get-ExchangeServer | Format-List InternetWebProxy
Migration test fails after you pointed the agent at a load balancerPoint it back at a single server with Update-HybridApplication and retest
Outlook mobile or HMA fails for on-premises mailboxesUnsupported with the agent; you need classic topology

Then confirm the Exchange Online side in Exchange Online PowerShell:

PowerShell
Get-MigrationEndpoint | Format-List Identity, RemoteServer
Get-OrganizationRelationship | Format-List Name, TargetSharingEpr
Test-MigrationServerAvailability -ExchangeRemoteMove:$true `
    -RemoteServer "<GUID>.resource.mailboxmigration.his.msappproxy.net" -Credentials (Get-Credential)

Good looks like this: both values carry the same msappproxy.net GUID, and the availability test, run with on-premises credentials, returns success.

Verify#

  • In Performance Monitor on the agent server, add the Microsoft AD App Proxy Connector object's # requests counter. It should rise when you run the migration test.
  • From a cloud mailbox, invite an on-premises user to a test meeting: the Scheduling Assistant shows their availability.
  • A test mailbox move completes; see my migration batch guide if it doesn't.

Tips and gotchas#

  • The agent's documented OS list ends at Windows Server 2022. If your Exchange SE servers run Windows Server 2025, put the agent on a supported server.
  • Where Extended Protection is enabled, read Microsoft's Extended Protection guidance for the Hybrid Agent before you install.
  • The HybridManagement module needs the Azure PowerShell module. Use -UserPrincipalName for MFA-enabled admins; -Credential falls back to basic authentication.
  • To remove the agent, rerun HCW on the same computer and choose classic connectivity. This uninstalls the agent and unregisters it.
  • Free/busy still broken after the agent checks out? Work through my hybrid free/busy guide.

References#

Written and checked against current Microsoft Learn documentation. Test changes with a pilot group before rolling them out to everyone, and if an admin center path has moved since, search for the setting name instead.

Spotted a mistake, or did this fix work differently for you? Email me or message me on LinkedIn — corrections are credited in the article.

Written by

Omer Eltayeb

Intune Subject Matter Expert in Cairo, Egypt, former Microsoft Cloud Solutions Architect, Microsoft Certified Trainer and Microsoft Innovative Educator Expert (2024–26) and Microsoft Elevate Educator Expert (2026–27). I share practical, step-by-step guides, study plans, scripts and toolkits for Microsoft Intune, Configuration Manager, Microsoft Entra ID, Microsoft Defender, Exchange and Microsoft 365 with the community.

Microsoft Certified Trainer (MCT) 2026Microsoft Innovative Educator Expert 2025–2026Microsoft Elevate Educator Expert 2026–2027ISC2 Certified Information Systems Security Professional (CISSP)Microsoft 365 Certified: Enterprise Administrator Expert (MS-102)