Delete User from Office 365

By |2017-12-04T10:47:43+00:00April 28th, 2014|Office 365|0 Comments

Had an issue with a user that had been synced been deleted from AD but DirSync had been offline during the deletion and the user was still showing.

You can delete the user using the following PowerShell commands that need to be run in the Windows Azure Active Directory Module for Windows PowerShell:

$msolcred = get-credential 
connect-msolservice -credential $msolcred
Remove-MsolUser –UserPrincipalName

This should remove the user and then you can take it one step further by removing it from the recycle bin:

Remove-MsolUser –UserPrincipalName –RemoveFromRecycleBin

Be warned that the user cannot be recovered if it has been removed from the recycle bin.



Leave A Comment

like what you see? 

Sign-up to our newsletter and never miss out on the latest blogs, events and tech news from the world of risual
Give it a try, you can unsubscribe anytime.