Home  /  Blog  /  Email Migration   /   How to Delete User Mailboxes in Exchange Online?

How to Delete User Mailboxes in Exchange Online?

Email Migration, by

You can use Office 365 admin center or Windows PowerShell for deleting Exchange Online mailboxes. The effect of deletion on the mailbox varies according to the process used. Soft-deleted user-mailbox is that mailbox which is deleted via Office 365 admin center or using cmdlet in Exchange Management Shell. This mailbox still will be residing in Azure Active Directory recycle bin for less than 30 days. Also, the mailbox is termed as soft-deleted if Azure active directory user account related with user mailbox has been hard deleted. Or, if user mailbox has been soft-deleted for more than 30 days, or the related Azure active directory user has been hard-deleted, the mailbox gets deleted forever.

2 ways to delete user mailbox in Exchange Online

You can delete Exchange Online mailboxes in two different ways:

  • Using Office 365 admin center
  • Using Windows PowerShell

Delete an Exchange Online mailbox using Office 365 admin center

The easiest method to delete a user-mailbox in Exchange Online is by using Office 365 admin center
If you delete a user account in Office 365, the related mailbox from Exchange Online gets deleted. And the user account in Office 365 gets listed in the Deleted Users page in Office 365 admin center. This user mailbox can be recovered within 30 days. After this time exceeds, it gets permanently deleted and cannot be recovered.

This is how you can delete the user mailboxes in Office 365:

  1. Log in with your Office 365 credentials. Click Admin.
  2. Log in Office 365 credentials

  3. Go to Users>Active Users. Select the user you want to delete. Then select Delete user option to delete that particular user mailbox.

Select the user you want to delete
Similarly, you can delete user mailboxes one-by-one. After deletion, to stop paying for the license assigned to the deleted user-mailbox, you need to remove its license. To do this, go to Office 365 admin center. Then, navigate to Billing>Subscriptions; select the subscription and then choose Add/Remove licenses to delete the license and stop paying for it.

Delete an Exchange Online mailbox using Windows PowerShell

You can permanently delete Exchange Online user mailboxes using Windows PowerShell:

  1. First connect your Office 365 account to Windows PowerShell by running the command.

    $UserCredential = Get-Credential

  2. A dialogue box pops up after the execution of this command. Enter the Office 365 credentials and click OK.
  3. Enter Office 365 credentials

  4. Next, enter the following command for connection:
  5. $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
  6. Now run:
  7. Import-PSSession $Session -DisableNameChecking
  8. To delete a user mailbox, run:
  9. Remove-Mailbox -Identity <mailbox identity>

    To view the user profiles residing in your deleted folder (as it resides in the deleted folder for 30 days period), run the following command:

    Get-MsolUser – ReturnDeletedUsers

     
    Command to view user profiles in deleted folder

  10. To delete the user mailbox permanently (i.e. to remove from the Recycle Bin), execute the following command:
  11. Remove-MsolUser -UserPrincipalName <mailbox identity> -RemoveFromRecycleBin

     
    Command to delete the user mailbox permanently

    Old and outdated user mailboxes are always undesirable and should be properly disposed of. These two easy methods provide solutions to get rid of unwanted data. Although, if you want to back up your Exchange Online mailboxes before deleting them, trust Kernel Office 365 Backup & Restore tool. It is an advanced Office 365 Backup tool to back up Exchange/Office 365 mailboxes and import PST files to Office 365.

    Download Now

    Leave a Reply

    Your email address will not be published. Required fields are marked *