Use this guide to stop syncing AD to a tenant and remove everything sync put there: when you move a school to a new tenant, or retire a test setup. Your AD accounts stay as they are.
A tenant is left clean, with nothing sync created.
Leftover synced accounts cannot be edited and will clash if you sync again.
Back up, scope users out, turn off directory sync, purge the accounts and remove the agents and domain.
Every name, address and value in this guide is an example. Replace them with your own.
What this guide removes
| From | Removed | Kept |
|---|---|---|
| The old tenant | Synced users, the sync configuration, its service account and the old sign-in domain | Cloud-only accounts, such as your admins |
| The sync servers | The agent registered to the old tenant | The servers and the gMSA |
| Active Directory | The old UPN suffix, once no account uses it | Every user, group and password |
Two routes
- Scope the users out
Point sync at an empty OU, and the next cycle deletes the users. Try this first.
- Turn off directory sync
If the cycle runs but deletes nobody, switch off sync for the tenant. The users turn into cloud accounts you can delete. You may need this route.
The route
- Take an inventory and a backup
- Scope the users out
- If they stay, turn off directory sync
- Delete and purge the users
- Remove the agents and leftovers
- Remove the old domain
Once purged, the old cloud accounts and their mailboxes, OneDrive files and Teams chats are gone. Move anything you need first.


