I need to recover an entire deleteditem aka dumpster folder.

Using Get-MailboxStatistics User@Domain.com | Select *Deleted* I am able to see 2.2+GB of data = 9,700+ emails.

How can I recover all of these?

I have seen Search-Mailbox "Discovery Search Mailbox" -SearchQuery <search query> -TargetMailbox <user> -TargetFolder inbox which I assume would work, but only for single searches and items. I need a batch solution. Any Office 365 PowerShell gurus?


You probably already have the answer, but for posterity, you may specify -SearchDumpsterOnly so it only returns deleted items:

Search-Mailbox -SearchDumpsterOnly "user@domain.com" -TargetMailbox tmprecoveryemailacct@domain.com -TargetFolder inbox
| improve this answer | |

I was able to piece together a solution. The following command recovered all contents:

Search-Mailbox "user@domain.com" -TargetMailbox tmprecoveryemailacct@domain.com -TargetFolder inbox

I needed to use Search-Mailbox without -SearchQuery. Apparently no wildcard options worked, but omitting it worked as a wildcard. Also, another caveat, you need to recover to a separate mailbox (much like HDD recovery, why I don't know). Hope this helps someone in the future.

| improve this answer | |
  • After running this (took about 4 hours) I realize this is not fine tuned enough. Expect an edit to this solution. As I stated in the question the Get-MailboxStatistics command resulted in 2.2GB of data in 9,700 emails...This solution resulted in the recovery of too much: ~7.9GB of data in ~35,000 emails. I need to somehow figure out how to pipe it through a findstr or something similar. Still open for any/all suggestions. – TryTryAgain Sep 15 '12 at 6:48

unfortunately search-mailbox cmdlet is no longer available. not sure why they removed it. There is no option to recover ONLY recoverable items..

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.