Custom Archive Policy using PowerShell

Hi, Guys follow this article to create a custom email archive policy for specific or all M365 Exchange Online mailboxes to instantly free up the Primary mailbox which helps you to prevent email bounce issues due to mailbox space full issue.

Before starting this please ensure you have a valid Exchange Online Archiving license assigned to the Mailbox or Mailbox has a valid Exchange Online Plan 2 license which is a prerequisite of this process.

Please change adminid@domain.com with your admin ID then run these commands to install the ExchangeOnlineManagement PowerShell module and login via your admin ID to M365 Exchange Online account it will ask for a password enter your password and hit the Sign in button.

Run below Powershell command to list exiting Retention Tags.

Run below Powershell command to create your custom Retention Tag by changing the name of Tag and Archiving days as per your requirement, one Retention Policy can have multiple Retention Tags this will be one of them.

Run below Powershell command to list exiting Retention Policies.

Run below Powershell command to create a custom archive Retention Policy using your custom Retention Tag.

Run below Powershell command to show full details of the particular mailbox.

Run below Powershell command to show Mailboxe used space

Run below Powershell command to show current archive policy

Run below Powershell command to apply your newly create archive policy to the mailbox

Run below Powershell command to check archive policy apply successfully to the mailbox.

Run below Powershell command and check the archive is enabled or not on the mailbox.

Run below Powershell command if the archiving is not enabled on the mailbox.

Run below Powershell command to check archiving mailbox auto-expanding future is enabled or not.

Run below Powershell command to enable auto-expanding of archiving mailbox, Please make sure you assigned a valid Exchange Online Plan 2 or Exchange Online Archiving license to the mailbox.

Finally, run the below Powershell command to manually trigger the archiving process on the mailbox.

Run below Powershell command to check mailbox usage size.

 

Once you are done with the above steps you can run the below PowerShell commands to apply the same archive policy to any other mailbox on day to day basis.

Run below PowerShell commands and login into the exchange online admin account.

Run below Powershell command to apply your archive policy to the mailbox.

Run below Powershell command to enable archiving on the mailbox.

Run below Powershell command to enable auto-expanding of archiving mailbox.

Run the below Powershell command to manually trigger the archiving process on the mailbox.

Run below Powershell command to check mailbox usage size

You have applied your custom arching policy to the mailbox.

I hope you found this informative and helpful.

Thank You for reading this Custom Archive Policy Article.

 

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *