question

chrisgreeson avatar image
0 Votes"
chrisgreeson asked xxBishopxx-2378 commented

Is there a way to delete more than 10 items at a time from the RecoverableItems folder?

Following this article: https://docs.microsoft.com/en-us/microsoft-365/compliance/delete-items-in-the-recoverable-items-folder-of-mailboxes-on-hold?view=o365-worldwide and on Step 5 it says to "....delete items in the Recoverable Items folder by using the New-ComplianceSearch and New-ComplianceSearchAction cmdlets. To Do this see Search for and delete email messages"



According to the article, "A maximum of 10 items per mailbox can be removed at one time."

I currently have users with 100GB of emails stuck in RecoverableItems folders and have to write a script to delete them 10 at a time with the New-ComplianceSearchAction cmdlet. Is there not any way around this or is there a better way to have emails removed from the mailbox?

office-exchange-server-administration
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I found that if you run the below command with your Compliance Search Action information, it will purge ten at a time over and over until your count equals 100. You can set the counter to 500 or higher. The "Sleep 2" allows the first purge to complete and continue on to the next one.


For($i=1;$i -lt 100;$i++){do{New-ComplianceSearchAction -SearchName recoverable_purge -Purge -PurgeType HardDelete -Confirm:$false -Force;Sleep 2}While($i -ge 100)}

You can see the numbers decreasing

31582-image.png















1 Vote 1 ·
image.png (47.7 KiB)

1 Answer

YukiSun-MSFT avatar image
0 Votes"
YukiSun-MSFT answered YukiSun-MSFT commented

From the articles you referenced, do you mean you are running Exchange Online and these user mailboxes are placed on hold or have single item recovery enabled?

If this describes your situation, considering that the recoverable items folder play an essitial role in preserving data for mailboxes on hold, normally it's recommended to use the New-ComplianceSearchAction cmdlet which has a limit of 10 items at one time to lower the potential impact of mistakes.

If you insist on deleting more than 10 items at a time, you can use the Search-Mailbox cmdlet instead. The example below searchs and deletes the items received in the last three months from user1's recoverable items folder:

 Search-Mailbox -Identity user1 -SearchDumpsterOnly -SearchQuery {Received:"2020/5/22..2020/8/24"} -EstimateResultOnly
 Search-Mailbox -Identity user1 -SearchDumpsterOnly -SearchQuery {Received:"2020/5/22..2020/8/24"} -DeleteContent

19774-search-mailbox.png

For more information, you may refer to this article: Clean up or delete items from the Recoverable Items folder in Exchange Online

Note: I tested in my Exchange Online lab using the scripts above and it worked on my end. But please be aware that the Search-Mailbox cmdlet is being retired from Exchange Online and Microsoft Support will no longer provide assistance (see the Warning message in the screenshot above).


Additionally, an alternative I can think of is to grant your account access to the mailbox in question and setup a new Outlook profile for the task, then you can use the MFCMAPI tool to proceed with deletion of the contents of the Recoverable items folder:

  1. Open MFCMAPI, select Session > Logon…, choose the newly created Outlook profile and click “OK”.

  2. In order to view the Recoverable Items folder, click Tools > Options, make sure the following two checkboxes are selected:
    19784-1.png

  3. Double click the target mailbox in the list, expand the Root Container tree to locate the “Recoverable Items” folder.

  4. Depending on whether the user has purged the item and whether the mailbox was placed on hold, the stuck items might be in different subfolders under the “Recoverable Items” folder. So you may go through the subfolders such as Deletions (corresponding with the Recoverable items folder visible in Outlook), Purges and DiscoveryHolds by double clicking them.

  5. To remove items from these subfolders, you can use Ctrl or Shift key to select multiple items, then go to Actions > Delete message, choose the Hard Delete option and click OK:
    19656-2.png
    Here's an article for your reference: Delete items in the Recoverable Items folder in Exchange Online.
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.


If the response is helpful, please click "Accept Answer" and upvote it.



search-mailbox.png (12.6 KiB)
1.png (16.0 KiB)
2.png (8.5 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@chrisgreeson , Just checking in to see how things are going with this issue. Did you get a chance to check the suggestions provided?


If the response is helpful, please click "Accept Answer" and upvote it.

0 Votes 0 ·

Do you still need assistance with this issue? Any update would be appreciated.


If the response is helpful, please click "Accept Answer" and upvote it.

0 Votes 0 ·