Mailbox Full - Unable to Delete Items

Created by Jackie Little, Modified on Wed, 30 Sep at 4:50 PM by Jackie Little

Exchange Online Mailbox Full and Recoverable Items Cleanup

Use this as a last resort when:

  • Mailbox is near or at quota.
  • User cannot delete messages.
  • Outlook on the web says to contact Administrator.
  • Deleted messages reappear.
  • Emptying Deleted Items fails.

Ensure you have your Global Administrator role enabled before starting.


Section 1: Connecting

  • Open Powershell as an Administrator.
  • Verify that the Exchange Online management module is installed:


Get-Module ExchangeOnlineManagement -ListAvailable | Sort-Object Version -Descending | Select-Object Name,Version,Path

  • If needed, install or update it:

Install-Module ExchangeOnlineManagement -Scope CurrentUser -Force -Allowclobber

OR

Update-Module ExchangeOnlineManagement -Force

  • Import the module:

Import-Module ExchangeOnlineManagement

  • Connect to Microsoft:

Connect-ExchangeOnline -UserPrincipalName your.name@europlacer.co.uk

  • Connect to IPPSSession to enable usable commands:

Connect-IPPSSession -UserPrincipalName your.name@europlacer.co.uk -EnableSearchOnlySession

  • Set a reusable mailbox variable for the target user (this means you can copy and paste the rest of the commands without editing):

$mailbox = “users.name@europlacer.co.uk”


Section 2: Status Checks

  • Record the starting state:

Get-Mailbox -Identity $mailbox | Format-List DisplayName, PrimarySmtpAddress, RecipientTypeDetails, RetentionPolicy, ArchiveStatus, LitigationHoldEnabled, RetentionHoldEnabled, SingleItemRecoveryEnabled, ComplianceTagHoldApplied, InPlaceHolds, DelayHoldApplied, DelayReleaseholdApplied, RecoverableItemsQuota, RecoverableItemsWarningQuota

  • Look in particular to see if any of the holds are enabled or true and make a note of it. Also make a note of any non-standard retention policies (the defaults are “Default MRM Policy, or “Org-wide Retenion Policy”).
  • Check total mailbox usage:

Get-EXOMailboxStatistics -Identity $mailbox | Select-Object DisplayName, TotalItemSize, ItemCount, DeletedItemCount

  • Check the Recoverable Items area:

Get-MailboxFolderStatistics -Identity $mailbox -FolderScope RecoverableItems | Sort-Object  FolderAndSubfolderSize -Descending | Select-Object Name,FolderAndSubfolderSize,ItemsInFolderAndSubFolders

  • This folder is hidden in Outlook and cannot be seen from the GUI.
  • Check all potential holds:

Get-Mailbox -Identity $mailbox | Format-List LitigationHoldEnabled, RetentionHoldEnabled, ComplianceTagHoldApplied, InPlaceHolds, DelayHoldApplied, DelayReleaseHoldApplied, SingleItemRecoveryEnabled

  • If any are enabled, disable them (this uses RetentionholdEnabled as an example so replace it with the relevant hold):

Set-Mailbox -Identity $mailbox -RetentionHoldEnabled $false

  • Check the applied policy:

Get-Mailbox $mailbox | Select-Object DisplayName,RetentionPolicy

  • It should show “Default MRM Policy”.


Section 3: Adjust Policy and Force Change

  • DO NOT CLOSE POWERSHELL
  • Also check within the Purview portal: Retention policies | Microsoft Purview the user will have the Org-wide Retention Policy active. Edit the policy and add their mailbox as an exception.
  • Once they are an exception, create another policy within Purview, dedicated to their mailbox only, to delete everything over the preferred time frame.
  • Return to the Powershell window and force the Managed Folder Assistant for the user’s mailbox:


Start-ManagedFolderAssistant -Identity $mailbox -FullCrawl

  • This will force Microsoft to force retention changes.
  • Monitor the mailbox:

Get-EXOMailboxStatistics -Identity $mailbox | Sort-Object FolderAndSubfolderSize -Descending | Select-Object -First 20 Name,Foldertype,FolderAndSubfolderSize,ItemsInFolderAndSubfolders

  • It will take a long time to run, so allow it so sit for a few days, before restoring the Org-Wide Retention Policy and any holds.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article