Whether you manage your mailbox well or not, there is a good chance that your mailbox will eventually fill up. When that happens, you can go through the options trying to clean up again. But a better option here is to utilize the Online Archiving feature that Microsoft 365 offers out of the box for free which provides users with additional mailbox storage space.
Once you turn on the archive mailbox, you immediately got up to 100GB of additional storage available to you. And when that additional storage runs out, Microsoft 365 automatically adds more storage space to your archive until the total size reaches 1.5TB if the Auto-Expand feature is turned on. And that is plenty.
To enable the archive mailbox for a specific user:
Enable-Mailbox $userid -Archive
And to enable it for all users that don’t have the archive feature enabled,
Get-Mailbox -Filter {ArchiveGuid -eq '00000000-0000-0000-0000-000000000000' -AND RecipientTypeDetails -eq 'UserMailbox'} | Enable-Mailbox -Archive
Once done, you will see an additional mailbox called Online Archive automatically showing up in Outlook or Outlook Web Access. You can manually move or copy messages between your primary mailbox and the archive one. Or, simply let the retention policy that is set in place take care of the business for you.
And the nice about it, you can easily search for it by simply switching the search option from Current Mailbox to All Mailboxes.
Even though the retention policy will kick in right away, you won’t see the actual archiving process happen right away. It is managed by the Managed Folder Assistant but if you can’t wait and would like to see that happen right away,
Start-ManagedFolderAssistant -Identity $userid
To check a mailbox’s archive status and archive quota,
Get-Mailbox $identity | Select DisplayName, ArchiveStatus, ArchiveQuota
To check how much online archive space was used for a certain mailbox,
Get-MailboxStatistics $identity -Archive | Select DisplayName, TotalItemSize
The default retention policy is to archive anything that is 2 years old. If that’s not enough, you can set up a new retention policy to shorten the period.
New-RetentionPolicy "Archive 1 Year" -RetentionPolicyTagLinks "Personal 1 year move to archive"
And assign the new policy to the mailbox that needs it.
Set-Mailbox $identity -RetentionPolicy "Archive 1 Year"
Finally, when the online storage runs out of space, it’s time to turn on the Auto-Expand feature, either do it on a mailbox level,
Enable-Mailbox $identity -AutoExpandingArchive
Or, do it at the organizational level.
Set-OrganizationConfig -AutoExpandingArchive
And to check whether a mailbox’s auto-expanding is on,
Get-Mailbox $identity | Select AutoExpandingArchiveEnabled Get-OrganizationConfig | Select AutoExpandingArchiveEnabled