Fix an OnPremiseSecurityIdentifier Conflict in Azure AD Connect
Question details
Resolve a duplicate OnPremiseSecurityIdentifier conflict and determine why the synchronized Microsoft 365 account remains after the user is moved out of scope.

- Product
- Azure AD Connect (Microsoft Entra Connect Sync)
- Device & OS
- not provided
- Scenario
- A user was restored from backup and Azure AD Connect was reinstalled. The user was then moved to an organizational unit excluded from synchronization.
- Observed behavior
- The synchronization trace reports a duplicate OnPremiseSecurityIdentifier, and the synchronized Microsoft 365 account remains present.
Identify the affected on-premises user, the conflicting cloud account, and any Exchange mail user associated with the identity. Have an administrator with access to the sync server, Active Directory, and Exchange review the synchronization errors and recipient configuration.
Check the on-premises Exchange mail user and resolve the conflict
Use this approach if the affected identity has an on-premises Exchange mail user that may be contributing to the duplicate identifier conflict.
In the reported case, removing the local mail user, synchronizing, and then recreating the user and mail user resolved the conflict. The cause may differ in another environment, so confirm the affected objects before making changes.
On the sync server, open Synchronization Service Manager and review the Operations tab for the failed run. Open the error details to identify the objects involved in the duplicate OnPremiseSecurityIdentifier.
In the on-premises Exchange Management Shell, run Get-MailUser -Identity "user@example.com" using the affected identity. Confirm that the returned mail user is the recipient associated with the conflict.
Review the mail user's properties in Exchange Management Shell, including its external email address and proxy addresses, and coordinate with the Exchange administrator before changing or removing it.
If the administrator confirms this is the affected mail user and approves the change, use Disable-MailUser -Identity "user@example.com" in Exchange Management Shell to remove its Exchange mail-enabled attributes while retaining the Active Directory user.
On the sync server, run Start-ADSyncSyncCycle -PolicyType Delta in PowerShell, then check Synchronization Service Manager for the result. If the user still needs to be mail-enabled, have the Exchange administrator use Enable-MailUser with the appropriate external email address and restore the required recipient settings.

Investigate why the out-of-scope user remains in Microsoft 365
Use this approach when moving the user to an excluded organizational unit has not produced the expected cloud account change.
Document Azure AD Connect troubleshooting in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface and compatibility with Microsoft Office formats, making it easy to move troubleshooting notes and reports between suites. It does not fix Azure AD Connect or replace directory synchronization.

Frequently Asked Questions
Why is the cloud user still present after I moved it to an excluded OU?
The change may not have been processed or exported, or a deletion safeguard may have stopped it. Check OU filtering in Microsoft Entra Connect and review recent operations in Synchronization Service Manager.
How can I check whether the user is an on-premises Exchange mail user?
In the on-premises Exchange Management Shell, run Get-MailUser -Identity "user@example.com" with the affected user's identity. Verify the returned recipient before making changes.
Does disabling a mail user delete the Active Directory account?
Disable-MailUser removes the user's Exchange mail-enabled attributes but retains the underlying Active Directory user. Review the recipient settings and effects with an Exchange administrator first.
How do I start a synchronization cycle after correcting the issue?
On the Microsoft Entra Connect sync server, run Start-ADSyncSyncCycle -PolicyType Delta in PowerShell. Then review the Operations tab in Synchronization Service Manager for errors and export results.




