I got an email request to help with deleting the emails in the recoverable items folder. Let’s find out how to delete the contents in the dumpster.
You may come across situations in which you want to delete the contents of the recoverable items folder and it will come in handy to know the cmdlet to use to make the process easier. Let me explain with my mailbox as an example.
Running Get-MailboxFolderStatistics will bring you the number of items you have in your mailbox. I have 11942 items in the deletions folder, which is part of the recoverable items folder structure in Exchange 2010.
Run the following command to delete the contents of the dumpster.
Search-Mailbox –identity alias –SearchDumpsterOnly –DeleteContent
Running Get-MailboxFolderStatistics again reflects the deletion.
Nice and easy!
Hi Rajith
when I use this command, deleted emails are moved from /Deletions folder to /Purges folder. Still not able to gain the space on user mailbox.
Search-Mailbox –identity alias –SearchDumpsterOnly –DeleteContent
Is there is a way to keep only 10 days emails in RecoverableItems and delete the older emails
Your help is highly appreciated
What if i want to empty the Recoverable Items Folder of the archive mailbox (the user’s primary in-place archive mailbox that is)?
Thanks Rajith,
That helped me out greatly today.
Some people may find it useful to know that you need to be in the Discovery Management role group AND need to add Mailbox Import Export to a role group they are a member of to be able to use all the cmdlets and switches listed here.
Correct Tom.
Thanks for the update.
This doesn’t seem to delete anything from the Recoverable Items folder itself, only from the Recoverable Items/Deletions folder.
I want to use the Search-Mailbox to delete the emails of a specific folder. How do I do it Searchquery does not provide me with the option.
How is this done in Office 365 (v15) ?
I don’t have “search-mailbox” cmdlet available ….
Thank you for ideas!
You comment was from nearly a year ago, so this might not be relevant:
Exchange Online / Office 365 DOES have the “Search-Mailbox” cmdlet but I’ve found we do NOT have the -DeleteContent parameter… Another option is to run the Get-MailboxFolderStatistics cmdlet and add some filtering to only show the Folders you want to see. Here’s one I ran against all folders like “Recoverable”:
Get-MailboxFolderStatistics -Identity “UPN” | Where-Object {$_.FolderType -like “*Recoverable*”} | Format-Table Name,FolderAndSubfolderSize,ItemsInFolderAndSubfolders -Auto
The commands
“Search-Mailbox –identity alias –SearchDumpsterOnly –DeleteContent”
and
Get-mailbox “User Name”| search-mailbox –searchquery “Subject:’*’” –DeleteContent -SearchDumpsterOnly
do not work for me , i get always the message “NamedParameterNoFound,Search-Mailbox” but my user is in the Discovery Managment Group
Hi Christopher,
In Exchange Shell, if you type in search- and “tab through”, does it fill in as search-mailbox?
The command “Search-Mailbox –identity alias –SearchDumpsterOnly –DeleteContent” only work on Exchange 2010 SP1. On Exchange 2010 SP2 the command than work for me was:
Get-mailbox “User Name”| search-mailbox –searchquery “Subject:’*’” –DeleteContent -SearchDumpsterOnly
Bye!
Hi Ricardo,
What happens when you run the first command? Any errors?