Dec 10 2022 01:09 AM
To find whether this discovery holds folder is completely full, use the below-mentioned command.
Step 1: Connect-ExchangeOnline
and then,
Step 2: Get-MailboxFolderStatistics -Identity user | select name,foldersize
Note: This DiscoveryHolds folder is having a limit of 100 GB. If it is full, we will get issues like "Unable to clear deleted items folder", "deleted items are getting auto-restored" etc.,
One of the reasons for this folder is full: If Organization Hold is turned on(All Exchange mailboxes are selected in Compliance Retention Policy) or the Individual ID is selected on Compliance Retention Policy.
Solution:
Please try the below-mentioned steps to overcome this issue.
Step 1: Exclude the DiscoveryHolds full ID in the Compliance Retention policy or run the below-mentioned commands in PowerShell.
Connect-IPPSSession
and then,
Set-RetentionCompliancePolicy -Identity "Compliance Retention Policy Name" -AddExchangeLocationException user
for multiple users,
Set-RetentionCompliancePolicy -Identity "Compliance Retention Policy Name" -AddExchangeLocationException user1, user2, user3
Now on PowerShell,
Connect-ExchangeOnline
and then,
Set-Mailbox -Identity user -RetainDeletedItemsFor 0
and then run the below-mentioned command two times.
Start-Managedfolderassistant -Identity user
Start-Managedfolderassistant -Identity user
After 2-3 minutes, run the below-mentioned commands.
Get-Mailbox "user" | FL DelayHoldApplied,DelayReleaseHoldApplied
If the output is received as true for any above-mentioned holds, then run the below-mentioned commands.
Set-Mailbox user -RemoveDelayHoldApplied
Set-Mailbox user -RemoveDelayReleaseHoldApplied
and then run the below-mentioned command two times.
Start-Managedfolderassistant -Identity user
Start-Managedfolderassistant -Identity user
After 2-3 minutes, this DiscoveryHolds folder will become zero as per the below-mentioned screenshot.
This process helped me a lot. If you have any doubts/concerns/suggestions about this post, please comment below.
Best Regards,
Venkat Kiran Kona.
May 23 2023 01:22 PM - edited May 23 2023 02:11 PM
SolutionGreat 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.
May 24 2023 09:57 AM
May 24 2023 12:38 PM
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
}
May 24 2023 11:49 PM
Nov 01 2023 09:32 AM
Hi this is something I've been looking for.
can you help me on this? i tried what you did but it doesnt work for me.
Set-Mailbox -Identity xyz -RetainDeletedItemsFor 0
Start-Managedfolderassistant -Identity xyz
Start-Managedfolderassistant -Identity xyz
Get-Mailbox xyz | FL DelayHoldApplied,DelayReleaseHoldApplied
>>DelayHoldApplied : False
>>DelayReleaseHoldApplied : False
Get-MailboxFolderStatistics -Identity xyz | select name,foldersize
Get-RetentionCompliancePolicy | foreach {Set-RetentionCompliancePolicy -identity $_.name -AddExchangeLocationException xyz}
Start-Managedfolderassistant -Identity xyz
Start-Managedfolderassistant -Identity xyz
Get-MailboxFolderStatistics -Identity xyz | select name,foldersize
Start-Managedfolderassistant -Identity xyz
Start-Managedfolderassistant -Identity "email address removed for privacy reasons"
Get-MailboxFolderStatistics -Identity xyz | select name,foldersize
Jan 30 2024 08:10 AM
Feb 04 2024 11:44 PM
Feb 04 2024 11:45 PM
May 23 2023 01:22 PM - edited May 23 2023 02:11 PM
SolutionGreat 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.