Forum Discussion
AZURE AD Contacts problem
hi kwo This is a known situation that can occur in hybrid environments where contact objects (typically Mail Contacts) get orphaned in Microsoft Entra ID (formerly Azure AD) after user deletions in on-premises AD. These orphaned objects often remain under Contacts because they were originally synced via Exchange attributes, not directly through the user object itself.
Here are some steps you can try to resolve it:
a.Check if they’re actually “Contact” objects in Entra ID
Run this in Microsoft Graph PowerShell:
Get-MgContact | Select-Object DisplayName, Mail, Id
If they appear here, it means they exist as contact-type objects, not users.
b.Clean up orphaned contacts manually
If confirmed, you can delete them with:
Get-MgContact | Where-Object {$_.Mail -like "*@yourdomain.com"} | Remove-MgContact
(Use filters carefully — test with -WhatIf first!)
c.Check Exchange Online for mail contacts
Sometimes, these are actually Mail Contacts synced via Exchange Online Directory.
Run:
Get-MailContact | Select DisplayName, ExternalEmailAddress
If they appear here, remove them with:
Remove-MailContact -Identity "DisplayName"
d.Run a Full DirSync / Entra Connect sync cycle
Force a sync to ensure the deletions replicate properly:
Start-ADSyncSyncCycle -PolicyType Initial
e.If still stuck
It could be an issue with Exchange Online Directory sync caching. In such cases:
Open a Microsoft 365 Admin Support ticket
Ask them to check for stale “DirSync: Contact” objects and perform a backend cleanup.