Fix it now
The wizard reached the end of its run and could not complete the OAuth portion. Microsoft’s documented response is short: run the Hybrid Configuration Wizard again, or configure OAuth manually using the published procedure. Before you do either, make sure you are running the current wizard, because an out-of-date one produces a related failure that no amount of rerunning fixes.
Get-AuthConfig | Format-List CurrentCertificateThumbprint
Get-AuthServer | Format-List Name,Enabled,IsDefaultAuthorizationEndpoint
Get-IntraOrganizationConnector | Format-List Name,Enabled,TargetAddressDomains
Get-PartnerApplication | Format-List Name,Enabled,ApplicationIdentifier
- Install the current Hybrid Configuration Wizard from aka.ms/hybridwizard before rerunning anything. If yours is version 16.x or earlier it does not update itself and has to be uninstalled and reinstalled.
- Rerun the wizard. That is the first option Microsoft gives for this warning, and a transient failure during the OAuth step is common enough to be worth one retry.
- If it fails again, check the objects above. Missing AuthServer, IntraOrganizationConnector or PartnerApplication objects tell you which part of the OAuth configuration did not land.
- Check the auth certificate has not expired: read the thumbprint from
Get-AuthConfig, then check its NotAfter withGet-ExchangeCertificate -Thumbprint <value> | Format-List NotAfter. - Test the trust in the direction that matters:
Test-OAuthConnectivity -Service EWS -TargetUri <remote EWS URL> -Mailbox <a mailbox>.
Microsoft’s second documented option is to configure OAuth by hand using its published procedure for OAuth authentication between Exchange and Exchange Online. Use that procedure rather than assembling the objects from memory.
If free/busy and cross-premises moves work afterwards, stop here. If the wizard fails at the same step every time, the next section covers what it is trying to do.
Why it happens
Microsoft’s page for this condition quotes the wizard’s own words: the HCW has completed, but was not able to perform the OAuth portion of your hybrid configuration; if you need features that rely on OAuth, you can try running the HCW again or manually configure OAuth using the published steps. The cause it gives is broad – an issue occurred that prevented OAuth from being configured, either transient or permanent. That vagueness is deliberate, and it is why rerunning is the first documented option rather than a shrug.
It matters more than the wording suggests, because the rest of hybrid can look correct while OAuth is broken. Mail flows, the shared namespace works, and then free/busy lookups, cross-premises mailbox moves and the features that depend on server-to-server trust fail quietly, days later, in a way nobody connects back to the wizard run.
The number HCW8064 is worth a note of its own. Microsoft does not publish it: the page that documents this condition does not carry the code at all. The condition is documented, the code is not, and the same is true of HCW8072 and HCW8028 – a search of Microsoft’s documentation for either returns nothing. Use the codes to correlate lines in your own log; do not look for an authoritative meaning that has not been published.
One neighbouring error is fully documented and is worth ruling out first because its fix is trivial. AADSTS50011 – the reply URL specified in the request does not match the reply URLs configured for the application – is caused by one of the wizard’s old reply URLs having been retired while the installed wizard still uses it. The fix is to install the current wizard, and versions 16.x and earlier will not update themselves, so they need uninstalling first.
The installed Hybrid Configuration Wizard is out of date
You have this one if AADSTS50011 in the run, or a sign-in that is rejected before the wizard gets anywhere near your organisation.
- Check the wizard’s version. If it is 16.x or earlier it will not update itself.
- Uninstall it, then install the current version from aka.ms/hybridwizard.
- Run it again from the same server and the same account.
- Only then go looking at objects in your own organisation.
Microsoft’s published cause is that an old reply URL the wizard used has been removed from the service and the installed wizard does not know. Nothing in Active Directory or in the tenant needs changing.
The failure was transient
You have this one if The wizard completed with the OAuth warning once, and nothing obvious is wrong.
- Run the wizard again. This is the first option Microsoft documents for this warning.
- Run it from the same on-premises server and with the same accounts, so you are repeating the run rather than changing it.
- Check afterwards that
Get-AuthServer,Get-IntraOrganizationConnectorandGet-PartnerApplicationreturn the objects you expect. - Test with
Test-OAuthConnectivitybefore deciding it worked.
The on-premises auth certificate has expired
You have this one if The thumbprint from Get-AuthConfig resolves to a certificate whose NotAfter has passed, and other OAuth-dependent features fail at the same time.
- Create the replacement with
New-ExchangeCertificate, using a self-signed certificate for this internal role. - Stage it:
Set-AuthConfig -NewCertificateThumbprint <thumbprint> -NewCertificateEffectiveDate <date>. - Publish it with
Set-AuthConfig -PublishCertificate, then clear the old one withSet-AuthConfig -ClearPreviousCertificate. - Restart the Microsoft Exchange Service Host service and IIS, and allow Active Directory replication to reach the other Exchange servers before testing.
This certificate is internal to the organisation and is not the one clients see. Replacing it changes nothing about what a browser trusts.
The account running the wizard cannot do what it is asked
You have this one if The step fails immediately and identically every time, and the log records an authorisation failure rather than a network one.
- Run the wizard as an account holding Organization Management on premises.
- Sign in to the tenant with an account holding an administrative role sufficient to register applications and change Exchange Online organisation settings.
- Check for a conditional access policy blocking the sign-in the wizard performs, and arrange an exclusion for the run rather than weakening the policy permanently.
- Rerun and watch whether the same step now proceeds.
The Exchange server cannot reach the identity endpoints
You have this one if The log records a connection or timeout failure while retrieving metadata, and the server has no direct outbound internet access.
- Confirm the Exchange server can reach Microsoft’s identity and metadata endpoints over 443, allowing for any proxy in the path.
- If a proxy is required, configure it for the server rather than relying on a per-user setting, and confirm it does not strip authentication headers.
- Check that TLS inspection is not replacing the certificate those endpoints present, which breaks the trust the wizard is trying to establish.
- Retest with
Test-OAuthConnectivitybefore rerunning the wizard.
Full reference
What OAuth carries, and what breaks without it
- Cross-premises free/busy lookups in both directions.
- Cross-premises mailbox moves and the tooling that drives them.
- Features that depend on server-to-server authentication between the on-premises organisation and Exchange Online, rather than on a user’s own credentials.
- None of these fail at the moment the wizard finishes, which is why an OAuth warning gets dismissed and then investigated a fortnight later as a free/busy problem.
The objects the wizard should have created
| Cmdlet | What it should show |
|---|---|
Get-AuthServer |
The authorisation server object for the tenant |
Get-IntraOrganizationConnector |
A connector describing the other organisation and the domains it covers |
Get-PartnerApplication |
The partner application registration used for server-to-server authentication |
Get-AuthConfig |
The current auth certificate thumbprint |
Test-OAuthConnectivity |
A successful result for the service and target you name |
Read them before you change anything. Which objects are missing tells you where in the sequence the wizard stopped, and that is far more useful than the log line that names the step.
Codes in this family, and what is actually published
| Code | Published by Microsoft? |
|---|---|
AADSTS50011 |
Yes. The reply URL specified in the request does not match the reply URLs configured for the application. Fix: install the current wizard |
HCW8064 |
No. The condition is documented; the code is not |
HCW8072 |
No. A search of Microsoft’s documentation returns nothing |
HCW8028 |
No. A search of Microsoft’s documentation returns nothing |
This is not a reason to ignore the numbers. They are stable within your own wizard log and they let you correlate a failure across runs. It is a reason to distrust any source that tells you exactly what HCW8072 means.
Replacing the auth certificate by hand
New-ExchangeCertificateto create the replacement. This role uses a self-signed certificate, not one from a public authority.Set-AuthConfig -NewCertificateThumbprint <thumbprint> -NewCertificateEffectiveDate <date>to stage it as the next certificate.Set-AuthConfig -PublishCertificateto roll it over immediately and deploy it to the Client Access servers.Set-AuthConfig -ClearPreviousCertificateto clear the certificate saved as the previous one.- Restart the Microsoft Exchange Service Host service and IIS, then allow replication before testing from another Exchange server.
Cleaning up after several failed runs
Removing hybrid objects on a system that is partly working interrupts free/busy and cross-premises operations while you rebuild. Record what exists before you start, remove objects one at a time, and check after each removal rather than sweeping.
- Inventory both sides before touching either. The on-premises objects are listed above; the tenant has its matching connector.
- Remove only what clearly belongs to the failed attempt. A partly cleaned hybrid is harder to diagnose than a broken one.
- Rerun the wizard rather than hand-building the remainder, so both organisations end up describing the same arrangement.
- Keep a note of what you removed and when, because the next person to look at this will need it.
- Where the wizard genuinely cannot complete OAuth, use Microsoft’s published manual procedure rather than assembling the objects from memory.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
HCW8064 |
Reported when the wizard completes without configuring OAuth. Microsoft documents the condition and its two fixes but does not publish this code | not published by the vendor |
AADSTS50011 |
The reply URL specified in the request does not match the reply URLs configured for the application. Caused by an out-of-date Hybrid Configuration Wizard using a retired reply URL | Microsoft Learn |
HCW8072 |
A wizard step failure recorded in the same run. Microsoft publishes nothing for this code; read the log line it appears on | not published by the vendor |
HCW8028 |
Another wizard step failure recorded in the same run. Microsoft publishes nothing for this code | not published by the vendor |
Confirm the fix worked
Get-AuthServer,Get-IntraOrganizationConnectorandGet-PartnerApplicationall return the objects you expect on premises.Get-AuthConfigreturns a thumbprint whose certificate has a NotAfter date in the future.Test-OAuthConnectivity -Service EWS -TargetUri <uri> -Mailbox <mailbox>succeeds.- A free/busy lookup across the hybrid boundary returns real availability rather than hash marks.
- A test mailbox move in the direction you need starts without an authorisation failure.
Questions people ask about this
Does this cost anything to fix?
No. The Hybrid Configuration Wizard is free, the OAuth objects are part of Exchange, and the auth certificate is self-signed. Nothing here is resolved by a purchase.
Is rerunning the wizard safe?
Yes, and it is the first option Microsoft documents for this warning. It writes to both organisations, so record your current connector and organisation relationship settings first, but rerunning is the intended recovery rather than a risk.
What does HCW8064 mean exactly?
Microsoft does not publish the code. It documents the condition it accompanies – the wizard completed without performing the OAuth portion – and gives two fixes: rerun the wizard, or configure OAuth manually using the published procedure.
Why should I update the wizard first?
Because a documented failure in this area is caused by exactly that. AADSTS50011 occurs when a reply URL the wizard used has been retired and the installed version does not know; versions 16.x and earlier do not update themselves and have to be uninstalled and reinstalled.
Can I configure OAuth by hand instead?
Yes. Microsoft publishes a procedure for configuring OAuth authentication between Exchange and Exchange Online organisations, and names it as the alternative to rerunning the wizard. Follow that procedure rather than creating the objects from memory.
