Overview

In Microsoft 365 Exchange Online, you may sometimes encounter an error when trying to disable Retention Hold on a mailbox using PowerShell. This issue can be confusing because it may occur even when the Recoverable Items folders appear to have free space.

This article explains:

The Error Scenario

When attempting to disable retention hold using the following command:

Set-Mailbox -Identity "[email protected]" -RetentionHoldEnabled $false

The command fails with an error similar to:

Error

This error indicates that Exchange Online is unable to write changes to the mailbox configuration.

Root Cause

The primary cause of this error is that the mailbox has exceeded its quota.

In Exchange Online:

Mailbox Quota Status

In this case, the mailbox had reached its quota limits.

Mailbox Quotas and Actual Storage

Get-Mailbox -Identity "[email protected]" | fl Prohibit*
Get-MailboxStatistics -Identity "[email protected]" | ft TotalItemSize, ItemCount

Output:

Storage

At this point, the mailbox was effectively full.

Recoverable Items Check

Initially, the Recoverable Items folders were checked for both the primary mailbox and archive mailbox.

Primary Mailbox – Recoverable Items

Get-MailboxFolderStatistics -Identity "[email protected]" -FolderScope RecoverableItems

Archive Mailbox – Recoverable Items

Get-MailboxFolderStatistics -Identity "[email protected]" -Archive -FolderScope RecoverableItems

Result:

recovarable item storage

Why the Error Occurs

Even though Recoverable Items had free space, Exchange Online still could not save mailbox configuration changes because:

Resolution

To resolve the issue, free space must be created in the primary mailbox.

What Was Done

  1. Unwanted emails were deleted from the mailbox

  2. Emails were soft deleted, which:

    • Removes them from the primary mailbox

    • Moves them to the Recoverable Items folder

  3. This action reduced the primary mailbox size

  4. After space was freed, the retention hold was disabled successfully

Set-Mailbox -Identity "[email protected]" -RetentionHoldEnabled $false
COmmand successfull

Key Takeaways

Conclusion

If you encounter MRMConfigInternalServerError or QuotaExceededException when modifying retention settings, always verify the primary mailbox quota first. Freeing even a small amount of space can immediately resolve the issue.