Break the Office 365 DirSync Link to an On-Premises User
Question details
Keep a restored Office 365 user from being deleted again by directory synchronization and manage the user independently in the cloud.

- Product
- Microsoft 365 and Microsoft Entra Connect Sync
- Device & OS
- not provided
- Scenario
- An administrator restores a cloud user whose object is linked to an on-premises directory account.
- Observed behavior
- The restored user is deleted during the next directory synchronization.
Identify the affected cloud user and the corresponding on-premises account, and check which organizational units are included in Microsoft Entra Connect Sync. You need administrator access to manage users and synchronization; removing an account from sync scope can delete its cloud user before you restore it.
Remove the on-premises account from sync scope and restore the cloud user
Use this approach to prevent the on-premises account from driving further synchronization of the restored cloud user.
Removing a synchronized account from scope normally causes its cloud user to be deleted on the next synchronization cycle. Restore that user afterward as a cloud-managed user, and keep the on-premises account out of scope to avoid a new synchronization match.
In Active Directory Users and Computers, move the affected account to an organizational unit already excluded from Microsoft Entra Connect Sync. Confirm the destination is out of scope before moving it, and do not change filtering for an entire organizational unit without checking which other users it affects.
On the Microsoft Entra Connect Sync server, open PowerShell and run Start-ADSyncSyncCycle -PolicyType Delta, or wait for the scheduled cycle. Confirm that the affected cloud user appears under Identity > Users > Deleted users in the Microsoft Entra admin center.
In the Microsoft Entra admin center, go to Identity > Users > Deleted users, select the affected user, and choose Restore user. Resolve any reported sign-in name or proxy address conflicts before completing the restore.
Open the restored user under Identity > Users > All users and check that the user is no longer shown as synchronized from on-premises. Confirm the user remains active after the next sync cycle and review their licenses and access.

Work with Office files in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for working with documents, spreadsheets, and presentations. Its Office format support helps you move existing files into your workflow, although it does not manage Microsoft 365 identities or fix DirSync.

Frequently Asked Questions
Why is the restored user deleted again?
The cloud user can still be affected by the on-premises account and synchronization scope. Check the account in Active Directory Users and Computers and the filtering configuration in Microsoft Entra Connect Sync before restoring the user again.
Where do I restore a deleted Microsoft 365 user?
In the Microsoft Entra admin center, go to Identity > Users > Deleted users, select the user, and choose Restore user. Complete the restore after the synchronization cycle has processed the account's removal from scope.
Can I still use Set-MsolUser to clear ImmutableID?
The MSOnline PowerShell module is retired, so the legacy Set-MsolUser command should not be the basis for a current procedure. First ensure the user is no longer synchronized, and consult current Microsoft Entra documentation if the source anchor must be changed separately.
What happens if I put the on-premises account back in sync scope?
A later synchronization may match the on-premises account to the cloud user again, depending on identifiers and matching settings. Keep it out of scope if the cloud user must remain independently managed.




