Delete An Office 365 User Using PowerShell

Following my Office 365 series of articles, In this article I’ll show you how I delete an Office 365 users using Microsoft PowerShell.

Like always, Before you start, Install the Windows PowerShell Module for Office 365 and connect to Office 365 using PowerShell.

Once connected I run the cmdlet below using to delete a user name user11:

Remove-MsOlUser –UserPrincipalName "[email protected]"

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