In Exchange, when a user deletes mail from there mailbox, it is retained within the dumpster for the period you have setup in your environment.
There may come a time when you need to clear out the dumpster for a mailbox instead of waiting for XX period of time.
To do this, you need to kick off a Search-Mailbox against the mailbox, here is the command to do so:
- Search-Mailbox -Identity User@domain.com -SearchDumpsterOnly -DeleteContent
Now if you launch the Exchange Management Shell again while this one is busy, you can run the following command to see the item count decline as it does its thing, here is the command:
- Get-Mailbox firstname.lastname@example.org | Get-MailboxStatistics | fl
If you want to check a bit more you can run the following command:
- Get-MailboxFolderStatistics -Identity email@example.com -FolderScope RecoverableItems | Format-Table Name,folderpath,itemsinfolder,folderandsubfoldersize
Hope it helps.