Wednesday, 9 September 2015

Remove User in Office 365

In this Article, we will cover how to remove users using PowerShell in Office 365. Users can be removed using Office 365 Admin Center as well.

In order to use the following command lets , the pre-requisite is to Install Windows Azure for Active Directory PowerShell, please refer to Microsoft TechNet Article.

Launch the Windows Azure for Active Directory Shortcut

Connect to Office 365 using the following command , and enter your credentials

Connect-msolservice 

Once you are connected, you can use the following command to remove a user

To Remove a User,

Remove-MsolUser –UserPrincipalName JohnSmith@contoso.com

This will prompt to remove any licenses that are assigned to the user. Once the account is removed, the user account is recoverable within 30 days from recycle bin

To Remove a User from Recycle Bin i.e. permanently delete

Remove-MsolUser –UserPrincipalName JohnSmith@contoso.com -RemoveFromRecycleBin

No comments:

Post a Comment