Common Azure AD Connect Errors & How to Fix Them

AD Connect: Resolving UPN Mismatches
Microsoft Entra ID / AD Connect

Fixing UPN vs. Email Mismatches

A step-by-step guide to resolving on-premises UPN misalignments that cause failed soft-matching and duplicate cloud accounts during Entra ID sync.

1 The Current Scenario

The table below shows three users. Where the on-premises UserPrincipalName does not match the cloud primary email, AD Connect cannot perform a soft match and will create duplicate accounts instead.

User On-Prem UPN Cloud Primary Email Status
Robin Pradhan robin.pradhan@maharjan-binod.com.np robin@maharjan-binod.com.np ✗ Mismatch
Bibek Aryal bibek.aryal@maharjan-binod.com.np bibek.aryal@maharjan-binod.com.np ✓ Match
Sushan BK sushan@maharjan-binod.com.np sushan.bk@maharjan-binod.com.np ✗ Mismatch
⚠️
Critical Risk: Mismatched UPNs will cause AD Connect to create duplicate cloud-only accounts or fail to merge existing Exchange Online mailboxes. Always fix attributes before the first sync.
2 The Fix: Align On-Prem UPN with Cloud Email

Update each mismatched on-premises UserPrincipalName to exactly match the cloud primary email. Run on a domain controller or any machine with the ActiveDirectory PowerShell module installed.

PowerShell
# Fix Robin: change UPN from robin.pradhan@ → robin@
Set-ADUser -Identity "robin.pradhan" `
           -UserPrincipalName "robin@maharjan-binod.com.np"

# Fix Sushan: change UPN from sushan@ → sushan.bk@
Set-ADUser -Identity "sushan" `
           -UserPrincipalName "sushan.bk@maharjan-binod.com.np"
ℹ️
The -Identity parameter accepts a SAM account name, distinguished name, GUID, or SID. It is required — positional binding is not supported by Set-ADUser.
3 Implementing the Sync

Before triggering a sync, confirm both users are inside an OU included in the AD Connect sync scope. Then trigger an Initial sync to force full re-evaluation of all objects.

PowerShell
# Verify connector is healthy first
Get-ADSyncConnectorRunStatus

# Trigger a full initial sync cycle
Start-ADSyncSyncCycle -PolicyType Initial
4 Final Result

After a successful sync, AD Connect performs a soft match by comparing the updated on-premises UPN against the cloud proxyAddresses / SMTP values. The accounts merge automatically — on-premises AD becomes the source of truth for identity attributes.

🚀 Pro Tip: Verify that maharjan-binod.com.np is a verified custom domain in the Microsoft 365 Admin Center (Settings → Domains) before your first sync. AD Connect will silently rewrite UPNs to the tenant’s default .onmicrosoft.com domain if the custom domain is not yet verified.

Set-ADUser robin.pradhan -UserPrincipalName robin@maharjan-binod.com.np

Leave a Reply

Your email address will not be published. Required fields are marked *