How to Fix the "Duplicate Attribute" Error During Active Directory and Cloud Sync

How to Fix the "Duplicate Attribute" Error During Active Directory and Cloud Sync

When synchronizing Active Directory (AD) with a cloud directory service like Azure AD (via Azure AD Connect), you may encounter the "Duplicate Attribute" error. This occurs when two or more objects in AD have the same value for an attribute that must be unique (e.g., userPrincipalName, proxyAddresses, or mail). Below, we’ll explore the causes, troubleshooting steps, and solutions to resolve this issue.

Common Causes of Duplicate Attribute Errors

  1. Non-Unique userPrincipalName (UPN) or mail Attributes

  • Multiple users share the same UPN (e.g., john.doe@company.com).
  • The same email address is assigned to multiple accounts.

  1. Duplicate proxyAddresses Entries

  • Two objects have the same SMTP address in the proxyAddresses attribute.

  1. Orphaned or Stale Objects

  • Deleted objects still exist in the AD recycle bin or Azure AD.

  1. Sync Rule Misconfigurations

  • Custom sync rules unintentionally generate duplicate values.

How to Fix the Duplicate Attribute Error

Step 1: Identify the Conflicting Objects

Use Azure AD Connect’s Synchronization Service Manager (miisclient.exe) to locate duplicates:

  1. Open Synchronization Service Manager (usually found in C:\Program Files\Microsoft Azure AD Sync\UIShell\miisclient.exe).
  2. Navigate to Metaverse Search and search for the duplicate attribute value (e.g., userPrincipalName).
  3. Note the conflicting objects (both should appear in search results).

Alternatively, use PowerShell to find duplicates:

Get-ADUser -Filter * -Properties userPrincipalName, proxyAddresses | Group-Object userPrincipalName | Where-Object { $_.Count -gt 1 } | Select-Object Name, Count        

Step 2: Resolve the Conflict

Option A: Modify the Duplicate Attribute

  • For userPrincipalName:
  • Change one user’s UPN to a unique value (e.g., john.doe2@company.com).
  • Update via Active Directory Users and Computers or PowerShell: Set-ADUser -Identity "JohnDoe" -UserPrincipalName "john.doe2@company.com"
  • For proxyAddresses or mail:
  • Ensure no two objects share the same SMTP address.
  • Remove or modify the duplicate entry: Set-ADUser -Identity "JaneDoe" -Remove @{proxyAddresses="SMTP:jane.doe@company.com"}

Option B: Clean Up Orphaned Objects

  • Check the AD Recycle Bin:
  • Restore or permanently delete conflicting objects.
  • Check Azure AD Soft-Deleted Objects: Get-MsolUser -ReturnDeletedUsers | Where-Object { $_.UserPrincipalName -eq "duplicate@company.com" }
  • Remove them with:

Remove-MsolUser -UserPrincipalName "duplicate@company.com" -RemoveFromRecycleBin -Force        

Option C: Adjust Sync Rules (Advanced)

  • If duplicates are caused by sync rules, modify them in Azure AD Connect’s Synchronization Rules Editor.

Step 3: Force a Full Sync

After fixing duplicates, manually trigger a sync:

  1. Open PowerShell as Administrator.
  2. Run:

Start-ADSyncSyncCycle -PolicyType Initial (This performs a full sync instead of delta sync.)        

 Preventing Future Duplicates

  1. Enforce Naming Policies

  1. Regular Audits

  • Run periodic checks for duplicates using PowerShell or third-party tools.

  1. Enable Azure AD Connect’s Duplicate Attribute Resilience

  • This feature auto-renames conflicting attributes during sync.

Conclusion

The "Duplicate Attribute" error in AD sync is typically caused by non-unique UPNs, proxyAddresses, or stale objects. By identifying and resolving conflicting attributes, cleaning up orphaned objects, and enforcing naming policies, you can ensure smooth synchronization between Active Directory and Azure AD.

For persistent issues, check Azure AD Connect logs (C:\ProgramData\AADConnect\SyncErrors-*.log) or consult Microsoft’s official documentation.

To view or add a comment, sign in

More articles by Md Mumit Siddique

Others also viewed

Explore content categories