How to Move Old Emails to Online Archive in Microsoft 365 using PowerShell

What Is Online Archive in Microsoft 365?

Online Archive is a separate mailbox linked to the user account where old emails are stored automatically.

 

Step 1: Connect to Exchange Online PowerShell

Open Windows PowerShell as Administrator.

Install Exchange Online module (only once)

Install-Module ExchangeOnlineManagement

Connect to Microsoft 365

Connect-ExchangeOnline

Step 2: Enable Online Archive for the User

Follow the blog: https://clients.activeservers.in/knowledgebase/290/How-to-Enable-Archive-Storage-for-Microsoft-365-BasicorStandard-Plans.html  

Verify archive is enabled:

Get-Mailbox user@domain.com | Select ArchiveStatus

If it shows:
Active
You’re good to proceed.

 

Step 3: Enable Organization Customization (One-Time)

Microsoft 365 tenants block retention commands by default.

Run this once only:

Enable-OrganizationCustomization

Wait 2–5 minutes before continuing.

 

Step 4: Create a Retention Policy Tag (Move to Archive)

This tag tells Microsoft:

“Move emails older than X years to archive”

Example: Move emails older than 2 years

New-RetentionPolicyTag -Name "MoveToArchive_2Years" `
-Type All `
-RetentionAction MoveToArchive `
-AgeLimitForRetention 730

730 days = 2 years

Step 5: Create a Retention Policy

New-RetentionPolicy -Name "ArchivePolicy_2Years"

Step 6: Link the Tag to the Policy

Set-RetentionPolicy "ArchivePolicy_2Years" `
-RetentionPolicyTagLinks "MoveToArchive_2Years"

Step 7: Assign Policy to a Specific User

Set-Mailbox user@domain.com -RetentionPolicy "ArchivePolicy_2Years"

Step 8: Confirm Policy Is Assigned

Get-Mailbox user@domain.com | Select RetentionPolicy

If you see:
ArchivePolicy_2Years

It is correctly applied.

Step 9: Monitor Archive Progress

Check archive mailbox size

Get-MailboxStatistics user@domain.com -Archive |
Select DisplayName,TotalItemSize,ItemCount

Example output:
In-Place Archive - User
6.124 GB
3918 items

Check last processing time
Get-MailboxStatistics user@domain.com |
Select DisplayName,LastProcessedTime

Recent time = policy is still running.

  • microsoft teams, outlook
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Add Additional/Extra Email Addresses to Microsoft 365

If you need to add extra email addresses, follow these steps: 1. Log in to Your Client...

Getting Started with Microsoft 365 from ActiveServers

Getting Started with Microsoft 365 from ActiveServers If you haven't purchased Microsoft 365...

How to Buy Microsoft 365 from ActiveServers

Follow the steps below to buy Microsoft 365 from ActiveServers: 1. Visit ActiveServers...

How to add users in Microsoft 365

Follow these simple steps to add users to Microsoft 365: Access the Microsoft 365 Admin...

How many Microsoft 365 plans are there?

Microsoft 365 Plans: What Options Does ActiveServers Offer?  Choosing the Right Microsoft 365...