Dirsync – After Deleting User from Office365 the User will not sync again

I Deleted a user and mailbox form Office 365 Tenant in an Hybrid environment with Dirsync
I tried to Sync the same user again and it didn’t show up in my Office 365 Tenant.

So I did two things

1. Deleted the User from the recycle bin by running this command in the DirsyncConfig powershell :

Remove-MsolUser –UserPrincipalName “UserPrincipalName” -RemoveFromRecycleBin –Force

2.Delete all Exchange attributes from Adsiedit for that user

3.Search for the User in dirsync , delete it and run the sync again

To search and delete I did the following steps:

1. Create a new search In Dirsync console

  • Open miisclient

"C:\Program Files\Microsoft Online Directory Sync\SYNCBUS\Synchronization Service\UIShell\miisclient.exe"

  • Open the tab " Metaverse Search"
  • Create a new search scope to find the user – click on Add Clause

image

2. Delete the user from office365

  • Double click the user
  • Open the tab "Connectors" , Select the SourceAD connector and click "Disconnect"
  • Go to the Management Agents tab
  • Right click the "TargetWebService" connector and choose "Run
  • Select the Full Confirming Import" run profile and click ok.

image

image

  • After its finished choose the "Export" run profile
  • In the next Sync the user will be recreated in Office 365

Add license for the user and the mailbox will be created.

Good luck Smile

About Idit Bnaya

Sr. Cloud Solution Architect at Microsoft, I’m passionate about helping customers succeed by building secure, scalable, and innovative cloud solutions – with a strong focus on AI, DevOps practices, and end-to-end security. With a proven track record in the IT and services industry, I serve as a trusted advisor, partnering closely with organizations to guide them through digital transformation and maximize the value of their cloud investments. My role combines technical leadership with project ownership – from designing modern architectures to leading cross-functional implementations that drive real business outcomes. I also manage and empower strategic partners, working hand-in-hand with them to ensure project success and deliver measurable business impact for customers.
This entry was posted in Office365 and tagged . Bookmark the permalink.

Leave a Reply