Graph and PowerShell Blog | About | Links
Deleting items from Recoverable Items
01-Nov-24

With Office365 E5 licenses a user gets a primary mailbox of 100GB. If you have enabled item retention and single item recovery then you will find that deleted items will count towards this 100GB total. Once you reach that limit it can be difficult to remove these items:

1. Remove the retention policy on the user mailbox. It will probably take about 3 hours before this kicks in.
2. Set single item recovery to false and change retain items range:
Set-Mailbox user@domain.com -RetainDeletedItemsFor 0
Set-Mailbox user@domain.com -SingleItemRecoveryEnabled $false
3. In Outlook, delete items and empty 'Recover Deleted Items'.
4. Download MFCMapi, logon to the mailbox, expand 'Recoverable Items' and select 'DiscoveryHolds'. Right-click on this folder, select 'Advanced', then select 'Empty items and subfolders from folder' with the 'Hard Deletion' checkbox checked.

You may come across a few issues, if you see MFCMapi return the following error then you can ignore it once the 'Deletions' folder is reduced:
Warning:
Code: MAPI_W_PARTIAL_COMPLETION == 0x00040680
Function lpMAPIFolderToEmpty->EmptyFolder( lpProgress ? reinterpret_cast(m_hWnd) : NULL, lpProgress, ulFlags)
File D:\a\1\s\UI\Dialogs\HierarchyTable\MsgStoreDlg.cpp
Line 717
If you see the error message but the item count is not reducing then it's likely the previous retention policy is still active.

You can check the usage via PowerShell as well:
Get-MailboxStatistics user@domain.com | ft DisplayName, TotalDeletedItemSize, DeletedItemCount

Once you have successfully deleted the items you should set the mailbox back to the previous settings.

References: TechNut.se