Forum Discussion
How to clear the Discovery Holds folder
- May 23, 2023
Great post, thank you. This helped me when both RecoveryItems and DiscoveryHolds were full. We had a lot of retention policies, so using this command excluded them from all polices:
Get-RetentionCompliancePolicy | foreach {Set-RetentionCompliancePolicy -identity $_.name -AddExchangeLocationException <user>}Also, it can take a lot more than a few minutes if the mailbox has a lot of items (in my case, 100GB). It's going very slow for me, maybe 1GB every hour or two.
This is working perfectly! I came in this morning and the deletions had stalled, tried your method of running it twice every 5 minutes and it's dropped from 99GB to 58GB in about an hour. Here's a snippet to do this every 5 mins automatically, and report the size of the folders:
while ($true) {
Start-ManagedFolderAssistant -Identity <email address removed for privacy reasons>
Start-ManagedFolderAssistant -Identity <email address removed for privacy reasons>
sleep 300
Get-MailboxFolderStatistics <email address removed for privacy reasons> -FolderScope RecoverableItems | Ft Name,FolderAndSubfolderSize
}
Thank you so much, I’m really grateful.
Along with the main solution, I have used your script adapted to my case, and it has been the definitive solution. After a few runs, in about 30 minutes, the folder size has reduced from 105GB to 30GB and it’s still decreasing!