Following my Office 365 series of articles, In this article I’ll show you how I delete an Office 365 users using Microsoft PowerShell.
Once connected I run the cmdlet below using to delete a user name user11:
Remove-MsOlUser –UserPrincipalName "firstname.lastname@example.org"
I can also delete a user using the cmdlet below getting the user first and then pipe It to a remove cmdlet:
Get-MsOlUser -SearchString "user12" | Remove-MsOlUser ` -Force