The retention policy that ran successfully and did nothing
One user’s mailbox stood at 98.44 GB against a ProhibitSend quota of 99 GB. The send stop was days away. About a week earlier a retention policy had been assigned that moves anything older than five years to the online archive, and the mailbox held more than ten years of mail. Nothing had moved.
The puzzling part was that nothing was failing: the Managed Folder Assistant had run, it had reported success, and there were no holds in the way. The answer, up front: here the MoveToArchive tag did nothing because the mailbox had no archive, and the assistant did not say so. It skipped the tag silently and logged a clean run with every counter at zero. The same gap turned out to apply to 2,033 of the 2,036 mailboxes on the tenant’s Default MRM Policy.
What I saw
The starting facts for the mailbox:
| Property | Value |
|---|---|
| Size | 98.44 GB, 407,198 items |
| Largest folder | Sent Items, 27.2 GB (89,348 items, going back to 2016) |
| Quotas | ProhibitSend 99 GB, ProhibitSendReceive 100 GB, RecoverableItems 30 GB |
| Retention policy | A retention policy with one tag: Default 5 year move to archive |
| Tag settings | Type All, 1825 days, MoveToArchive, WhenDelivered |
The expectation was that the assistant would pick up the policy, move the old mail out and the mailbox would shrink. It had not shrunk at all.
Working it out
The first question with any MRM complaint is whether the Managed Folder Assistant has processed the mailbox since the policy changed. The mailbox diagnostic log shows it. Every block in this post runs in a PowerShell session with the ExchangeOnlineManagement module, already connected with Connect-ExchangeOnline as an Exchange administrator. This first block sets $upn to the affected mailbox, and the later blocks reuse it:
$upn = 'user@contoso.com' # example value: the affected mailbox
$x = Export-MailboxDiagnosticLogs $upn -ExtendedProperties
([xml]$x.MailboxLog).Properties.MailboxTable.Property |
Where-Object Name -like 'Elc*' | Format-Table Name, Value
The last successful run was the night before, at 03:34. So the assistant had run after the policy was assigned, and it had succeeded. The counters were all zero: nothing tagged with an archive action, nothing archived from the root.
That ruled out waiting for the next scheduled run and made the problem more interesting. A successful run that touches nothing on a mailbox full of mail older than five years is not a timing issue.
Next I checked everything that can stop MRM from acting on a mailbox:
RetentionHoldEnabled: FalseLitigationHoldEnabled: FalseInPlaceHolds: emptyElcProcessingDisabled: False
No holds, and ELC processing was not disabled. The MRM log did contain two errors, both ResourceUnhealthyException, but they were from years earlier and had nothing to do with this. Read the dates on old errors before you chase them.
With the assistant running and nothing blocking it, the remaining question was the destination. The policy does not delete anything. Its only tag moves items to the online archive. So I looked at the archive:
ArchiveStatus: NoneArchiveGuid: empty
The mailbox had no archive. The policy had nowhere to move anything, and the assistant had dealt with that by doing nothing and reporting success.
The cause
A MoveToArchive retention tag is only acted on when the mailbox has an archive. In this case there was none, and the Managed Folder Assistant skipped the tag without an error. The run was recorded as successful and the counters showed zero, which reads exactly like “nothing was old enough to move”.
Assigning the policy was half of the job. Enabling the archive was the other half, and the run gave no sign of the missing half.
The fix
We agreed that the policy should stay a move policy, not a delete policy. Total storage keeps growing in the archive, but the primary mailbox shrinks below the quota. Because the mailbox held more than ten years of mail, much of it older than five years, the archive could outgrow a standard archive, so I enabled auto-expanding archiving as well. The organisation-level AutoExpandingArchiveEnabled was False, so it went on per mailbox. These are two separate calls because -Archive and -AutoExpandingArchive belong to different parameter sets of Enable-Mailbox, and the archive must exist before auto-expanding can be turned on (same session, $upn from the first block):
Enable-Mailbox -Identity $upn -Archive
Enable-Mailbox -Identity $upn -AutoExpandingArchive
The archive came up with an ArchiveQuota of 110 GB and a warning at 100 GB.
Rollback is not symmetric, so it is worth knowing before you run either line:
Disable-Mailbox -Identity $upn -Archivedisconnects the archive. It stays disconnected for 30 days, and runningEnable-Mailbox -Identity $upn -Archiveagain within that window reconnects the same archive (Connect-Mailbox -Archiveis the on-premises equivalent and does not exist in Exchange Online). This is only safe before items have moved, because they go with the archive.- Auto-expanding archiving cannot be turned off for a mailbox once it is on. There is no rollback for that line.
With the archive in place I did not want to wait up to seven days for the next scheduled run, so a minute later I started the assistant by hand, in the same session:
Start-ManagedFolderAssistant -Identity $upn
It failed:
gRPC call for assistant 'ElcHighPriorityAssistant' ... failed with ErrorCode=0x80040200
0x80040200 is -2147220992. It is a known error straight after an archive has been enabled: the identity is now ambiguous, and the fix is to pass the GUID of the primary mailbox instead. Get-MailboxLocation gives you that, filtered to the location of type Primary (same session, $upn from the first block):
$primary = Get-MailboxLocation -User $upn -MailboxLocationType Primary
$primary | Format-List MailboxLocationType, MailboxGuid
Start-ManagedFolderAssistant -Identity $primary.MailboxGuid
Get-MailboxLocation printed a warning that the object “has been corrupted … Id: You must provide a value”. That looks like a cosmetic validation bug in the cmdlet, not corruption. With the primary MailboxGuid, Start-ManagedFolderAssistant succeeded, eight minutes after the first attempt.
A first assistant pass over roughly 407,000 items can take hours to a couple of days, so I planned to check again the next day. Success means a newer ELCLastSuccessTimestamp and ElcLastRunArchivedFromRootItemCount above zero in the same diagnostic log, and Get-MailboxStatistics showing the primary shrinking while the archive (-Archive) grows.
It did not take a day. An hour after the assistant run, the primary mailbox had dropped from 98.44 GB to 93.92 GB.
The tenant-wide sweep
If one mailbox had a move-to-archive policy and no archive, the obvious question was how many others did. I ran a read-only inventory of all user and shared mailboxes in the tenant with Get-EXOMailbox and Get-EXOMailboxStatistics, covering size and retention, and exported it to CSV. It took about ten minutes. The block below is a shortened example of the method, not the exact script that ran; it needs the same connected Exchange Online session and only reads:
# Example of the method, not the exact script that ran
$mailboxes = Get-EXOMailbox -ResultSize Unlimited `
-RecipientTypeDetails UserMailbox, SharedMailbox `
-Properties RetentionPolicy, ArchiveStatus, ProhibitSendQuota
$report = foreach ($mbx in $mailboxes) {
$stats = Get-EXOMailboxStatistics -Identity $mbx.UserPrincipalName
[pscustomobject]@{
UserPrincipalName = $mbx.UserPrincipalName
Type = $mbx.RecipientTypeDetails
RetentionPolicy = $mbx.RetentionPolicy
ArchiveStatus = $mbx.ArchiveStatus
ProhibitSendQuota = $mbx.ProhibitSendQuota
TotalItemSize = $stats.TotalItemSize
ItemCount = $stats.ItemCount
}
}
$report | Export-Csv -Path .\mailbox-retention-report.csv -NoTypeInformation
The results:
- The same five-year policy without an archive: one more mailbox, a shared mailbox near 90 GB, at 90 % of its quota. The other seven mailboxes on that policy had archives.
- The Default MRM Policy: it contains the default tag
Default 2 year move to archive. Of the 2,036 mailboxes on it, 2,033 had no archive. For those 2,033 the policy did nothing, while looking assigned and healthy. - No policy at all: 832 mailboxes had an empty RetentionPolicy.
- Sizes: 5 mailboxes over 90 GB, 93 between 50 and 90 GB, 294 between 25 and 50 GB.
- Close to the 99 GB send stop: five more user mailboxes between 87.4 and 94.9 GB. The largest had an archive but no retention policy at all.
- Shared mailboxes against their 50 GB quota: one at 91 GB, 184 % of its quota, probably converted from a user mailbox and no longer receiving mail. Seven more were between 92 % and 100 %.
So the archive is not enabled by default in this tenant, and the Default MRM Policy moves nothing for 2,033 of its 2,036 mailboxes, and a further 832 mailboxes have no retention policy at all. Anyone who looks at the policy assignments sees retention in place. Anyone who looks at the mailbox sizes sees that it is not working.
What to do about that is a decision, not a fix. Enabling archives broadly changes where mail lives for a large part of the tenant, and archives over 50 GB on shared mailboxes need an Exchange Online Plan 2 or Exchange Online Archiving licence. So the sweep went back as a question for the business rather than as something to run inside a single ticket. The shared mailbox on the five-year policy without an archive is first on the list, with a licence check before enabling anything.
What I take with me
- Silence is not innocence: a successful run with zero counters is not “nothing to do”, so check that the action has somewhere to go.
- A policy shown as assigned tells you the intent; the mailbox sizes tell you the result.
- Read the dates on old errors before you chase them.
- When a cmdlet fails right after you change the object it targets, try the unambiguous identity, here the primary MailboxGuid.
- When one mailbox shows a configuration gap, sweep the tenant for it before you close the ticket.