Others

Break the Office 365 DirSync Link to an On-Premises User

Algirdas JasaitisAlgirdas Jasaitis Nov 27, 2026 869 views

Question details

Keep a restored Office 365 user from being deleted again by directory synchronization and manage the user independently in the cloud.

Break the Office 365 DirSync Link to an On-Premises User
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.
Before you start

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.

Solution 1Recommended

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.

1
Exclude the on-premises account

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.

2
Run or wait for synchronization

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.

3
Restore the cloud user

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.

4
Verify independent management

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.

Remove the on-premises account from sync scope and restore the cloud user
About the legacy ImmutableID command: Older instructions use Set-MsolUser to clear ImmutableID, but the MSOnline PowerShell module is retired. Do not rely on that command for a current deployment; if you need to change the source anchor separately, consult current Microsoft Entra guidance and verify that the user is no longer synchronized.
Free Microsoft Office alternative

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.

Open and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for everyday document workWork with Office files independently of the DirSync troubleshooting processGet a free, lightweight suite for common productivity tasks
microsoft office alternative - wps office

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.