Recently i had a situation where a user with a shared mailbox which had a ludicrous number of items. He recently started in the role and wanted to “start fresh” – but items could not be deleted.
A quick investigation found that litigation hold had been enabled for the mailbox (in addition to our org wide retention policies). It was unclear why the litigation hold had been enabled – and the reasons were lost due to staff turnover.
Finding and fixing the issue included:
- get-mailbox <identity> | fl *hold*
- This command will show the status of all holds on that specific mailbox. In my case, i could see that “LitigationHoldDate” and “DelayHoldApplied” were populated
- In order to remove these i ran
- get-mailbox <identity> | Set-Mailbox -LitigationHoldEnabled $false
- get-mailbox <identity> | Set-Mailbox -RemoveDelayHoldApplied
- After running these steps – i was still not able to delete items from the mailbox, so i ran
- get-mailboxFolderStatistics <identity> -FolderScope RecoverableItems | FL Name,FolderAndSubfolderSize,ItemsInFolderAndSubfolders
- and could see that the recoverable items and purges were both at 100GB – meaning that the quota, which also applied to delete items was full – so i could not yet delete anything more
- In order to speed up the process of the managed folder assistant doing its job, run
- Start-ManagedFolderAssistant -Identity <identity> -FullCrawl -HoldCleanup
- After some time, if you re-run the get-mailboxFolderStatistics command, you should see the recoverable items and purges start to come down
- Since this mailbox was full and is receiving a very high volume of new mail – the 100GB limit was going to be hit again very quickly – so in order to mitigate that for this initial cleanup, i then set
- Set-Mailbox -Identity <identity> -RetainDeletedItemsFor 1
- This will only detain deleted items for 1 day in the dumpster before purging
- I will set this back to 30 days once the initial cleanup is complete and the mailbox is back to “normal” operation.
- If the mailbox also has a retention policy in addition to the litigation hold
- get-mailbox -Identity <identity> -Archive | fl *holds*
- Take note of the ID of the in place hole
- Connect-IPPSSession
- Get-RetentionCompliancePolicy | fl Name,ExchangeObjectId
- Match up the id of the retention policy to a name
- Set-RetentionCompliancePolicy -Identity <NameOfPolicy> -AddExchangeLocationException <useridentity>
- Get-Mailbox <identity> | FL DelayHoldApplied,DelayReleaseHoldApplied
- Set-Mailbox <identity> -RemoveDelayHoldApplied
- Set-Mailbox <identity> -RemoveDelayReleaseHoldApplied
- Start-ManagedFolderAssistant -Identity <identity> -FullCrawl -HoldCleanup
- <wait>
- To check the status, use
- get-mailboxFolderStatistics <identity> -FolderScope RecoverableItems | FL Name,FolderAndSubfolderSize,ItemsInFolderAndSubfolders
- get-mailbox -Identity <identity> -Archive | fl *holds*
I’ve read some articles that say that “Start-ManagedFolderAssistant” needs to be run twice to pick up the new settings – but its all a bit of black magic because we cant see what is happening at the backend…. i tend to run it two or three times – as if those articles are right, im speeding things up, if they are wrong, there is no visible harm.