Delete all of the Mailbox content using Exchange PowerShell

Hi ;
In occasional cases you may be needing to delete the mailbox content from an user;

In order to do so run the following from the Exchange Console /

Verify prior using the second command the items :

Get-MailboxFolderStatistics -Identity username@company.com | Select FolderPath,ItemsInFolder

Run the serach to delete
Search-Mailbox -Identity "Example User" -SearchQuery "kind:meetings" -DeleteContent
and for finishing empty dumpster :

Search-mailbox -identity "username@company.com" -SearchDumpsterOnly -DeleteContent

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.