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

Advertisements

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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s