Delete Content from Recoverable Items Fails

Rob Murr 20 Reputation points
2025-10-08T15:48:01.25+00:00

I am migrating my Exchange 2016 environment to 2019. Before moving the mailboxes I run the script:

Search-Mailbox -Identity "User Name" -SearchDumpsterOnly -TargetMailbox "Discovery Search Mailbox" -TargetFolder "User Name-RecoverableItems" -DeleteContentMost users have done so without error.

However, several of the larger mailboxes (20+ GB) returns the error:

Target mailbox is out of space.

***+ CategoryInfo          : ReadError: (0:Int32) [Search-Mailbox], SearchMailboxException    + FullyQualifiedErrorId : [Server=MyServerName,RequestId=ad297139-01b7-48b1-8974-ad9ae83f0c18,TimeStamp=10/8/2025 3:2   7:16 PM] [FailureCategory=Cmdlet-SearchMailboxException] 2C20E399,Microsoft.Exchange.Management.Tasks.SearchMailbox    + PSComputerName        : MyComputerName***
```I've looked up the error and it says basically that the mailbox has exceeded storage limits. However, I have unlimited user mailbox storage on both the server I'm migrating from and the server I'm migrating to. I don't want to move mailboxes that have GBs of deleted data. For example, one mailbox after the user cleaned it up is 6 GB (including emptying Deleted Items). The MailboxRecoverableItems is 12 GB. When I run the above script it errors out.

And suggestions?

Thanks,

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Hani-Ng 5,000 Reputation points Microsoft External Staff Moderator
    2025-10-09T03:32:14.9433333+00:00

    Hi Rob Murr

    Thank you for posting your question in Microsoft Q&A.

    Based on your description, I understand you are encountering a "Target mailbox is out of space" error when using the Search-Mailbox cmdlet to clear the Recoverable Items folder for large mailboxes as part of your Exchange 2016 to 2019 migration.

    This error message is literal, but it does not refer to the user mailbox you are trying to clean. The storage limit that has been exceeded pertains to the target mailbox specified in your script, in this case, the "Discovery Search Mailbox".

    Here are some recommendations you can try:

    Option 1: Skipping the copy step

    The reason I recommended skipping the copy step is because the error you're encountering isn't related to the user mailbox, it’s due to the Discovery Search Mailbox quota. Even if user mailboxes have unlimited storage, the Discovery mailbox typically has a fixed limit (usually 50 GB). When large Recoverable Items folders are copied into it, it quickly fills up and causes failures.

    If your goal is simply to reduce mailbox size before migration, there's no need to copy the data elsewhere. You can delete it directly from the Recoverable Items folder using this simplified command:

    Search-Mailbox -Identity "User Name" -SearchDumpsterOnly -DeleteContent
    

    It goes straight to the Recoverable Items folder which is where deleted items are stored behind the scenes and permanently deletes everything in there. It doesn’t touch the Discovery mailbox at all, so you won’t run into any quota limits or errors related to that.

    The Recoverable Items folder isn’t something users see or interact with directly. It’s mainly used for retention policies or legal holds. So, if you’re not required to keep that data for compliance reasons, deleting it is a quick and safe way to reduce mailbox size before migration.

    Option 2: Recommended Solution for Exchange 2016/2019 (Use Compliance Search)

    The Search-Mailbox cmdlet is considered a legacy tool. For Exchange 2016 and later, the recommended method is to use the more powerful and scalable Compliance Search cmdlets. This modern approach does not require a target mailbox to store results before deletion, thereby avoiding the quota issue entirely.

    New-ComplianceSearch (ExchangePowerShell) | Microsoft Learn

    I hope this information is helpful. And of course, if you have any additional concerns, feel free to comment below.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.