First you need to remove the user from DirSync:
Open the “Synchronization Service Manager” (cn be fount at “C:Program FilesWindowsAzureActiveDirectorySyncSYNCBUSSynchronization ServiceUIShellmiisclient.exe”)
Navigate to “Metaverse Search” and click on “Add Clause”
Be sure that you choose Displayname as Attribute, and then configure your search, in my case Show all objects starting with svc
Double click an entry, and open the tab connectors
Activate the line with the “Active Directory Connector” Management Agent and click on “Disconnect…
In the disconnect object accept question, choose “Disconnector (Default)” to remove the connector. Explicit Disconnector will lock the object to be a connector again.
You can then rerun your search, and the specific account will not be shown anymore. And after a sync, the object will also be be removed from the azure Directory
Then you need to remove the user object from the Office 365 portal using the PowerShell
Open PowerShell “Windows Azure Active Directory Module”
$msolcred = get-credential
connect-msolservice -credential $msolcred
Get-MsolUser -ReturnDeletedUsers | FT UserP*,ObjectId
Remove-MsolUser -ObjectId abc1234-12abc-123a-ab12-a12b3c4d5f6gah -RemoveFromRecycleBin -Force
Get-MsolUser -ReturnDeletedUsers | Remove-MsolUser -RemoveFromRecycleBin -Force
Then at the next scheduled sync of te DirSync the user will be recreated. Also you can force the DirSync to creaate the user faster.
Pantelis Apostolidis is a Sr. Cloud Solutions Architect professional at Office Line SA and a recognized Microsoft Azure MVP. For the last 15 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.