How to delete the content of a users' mailbox
You would like to delete the content of a user's mailbox in Exchange Server or Exchange Online (Office 365).
To delete items from mailboxes on any on-premises Exchange servers, you can use a free third-party tool - MFCMAPI. Please refer to the vendor's website for details.
Additionally, in Exchange Server 2013, 2016 or in Exchange Online (Office 365) you can remove a mailbox content from within ECP. See below hot to do this:
- Log in to the Exchange Control Panel (ECP).
- Go to permissions, admin roles, select Organization Management, click Edit.
- Click the plus (+) button under Roles.
- Select and add:
- Mailbox Import Export
- Mailbox Search
- Click OK, Save, close ECP. Log out of Windows and re-log back in.
- Log on to the Exchange Management Shell (in the case of Exchange Online, log on via PowerShell).
- (Optional) Run the PowerShell cmdlet below to check how many items you will be deleting in the next steps:
Get-MailboxFolderStatistics <mailbox-name> | Select Identity, ItemsInFolder
- Run the PowerShell cmdlet below to delete the mailbox content:
Search-Mailbox -Identity "<MailboxOrMailUserIdParameter>" -DeleteContent -force
The MailboxOrMailUserIdParameter may be provided as an alias, canonical DN, display name, distinguished name and more. Please see this TechNet article for further reference.
If you want to delete content of multiple mailboxes or are looking for more options, you may find this article helpful.