Microsoft 365 Mailbox Management and Archiving Guide
Learn how to manage Microsoft 365 mailboxes effectively with this comprehensive guide. From enabling archiving and configuring auto-expanding archives to setting up retention policies using PowerShell, this guide ensures your organization stays compliant with data management regulations.
Table of Contents
- 1. Enable Script Execution
- 2. Install and Update Required Modules
- 3. Connect to Exchange Online
- 4. Enable Archive Mailbox
- 5. Enable Auto-Expanding Archive
- 6. Check Auto-Expanding Archive Status
- 7. Configure Retention Policies
- 8. Run the Managed Folder Assistant
- 9. Check Archive Status
- 10. View Retention Policy Tags
- 11. Remove Retention Policy
- 12. Disable Archive Mailbox
1. Enable Script Execution
To run PowerShell scripts, you need to set the execution policy to RemoteSigned
. This allows you to run scripts that are created locally but requires scripts downloaded from the internet to be signed by a trusted publisher.
Set-ExecutionPolicy RemoteSigned
2. Install and Update Required Modules
To manage Microsoft 365 mailboxes, you need to install and update the necessary PowerShell modules.
Install-Module -Name ExchangeOnlineManagement
Update-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement
Install-Module MSOnline
3. Connect to Exchange Online
To manage mailboxes, you need to connect to Exchange Online using your admin credentials.
Connect-ExchangeOnline -UserPrincipalName [email protected]
To disconnect after completing your tasks:
Disconnect-ExchangeOnline
4. Enable Archive Mailbox
To enable the archive mailbox for a specific user:
Enable-Mailbox -Identity [email protected] -Archive
5. Enable Auto-Expanding Archive
For a Specific Mailbox
To enable auto-expanding archive for a specific mailbox:
Enable-Mailbox [email protected] -AutoExpandingArchive
For the Entire Organization
To enable auto-expanding archive for the entire organization:
Set-OrganizationConfig -AutoExpandingArchive
6. Check Auto-Expanding Archive Status
To check if auto-expanding archive is enabled for the organization:
Get-OrganizationConfig | FL AutoExpandingArchiveEnabled
To check the status for a specific mailbox:
Get-Mailbox [email protected] | FL AutoExpandingArchiveEnabled
7. Configure Retention Policies
Create a Retention Policy Tag
To create a retention policy tag that moves items to the archive after 1095 days (3 years):
New-RetentionPolicyTag "Bexpetro-Archive" -Type All -RetentionEnabled $true -AgeLimitForRetention 1095 -RetentionAction MoveToArchive
Create a Retention Policy
To create a retention policy and link it to the retention policy tag:
New-RetentionPolicy "Bexpetro-Archive" –RetentionPolicyTagLinks "Bexpetro-Archive"
Apply Retention Policy to a Mailbox
To apply the retention policy to a specific mailbox:
Set-Mailbox [email protected] -RetentionPolicy "Bexpetro-Archive"
8. Run the Managed Folder Assistant
The Managed Folder Assistant processes retention policies. To manually trigger it for a specific mailbox:
Start-ManagedFolderAssistant -Identity [email protected]
Alternatively, you can use the MailboxGuid
to start the assistant:
Start-ManagedFolderAssistant -Identity 77585327-1cbd-4b2d-ba51-5ed09af6b0cc
9. Check Archive Status
To check the archive status for all mailboxes:
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, ArchiveStatus
10. View Retention Policy Tags
To view all retention policy tags in your organization:
Get-RetentionPolicyTag
11. Remove Retention Policy
To remove a retention policy from a specific mailbox:
Set-Mailbox -Identity [email protected] -RetentionPolicy $null
12. Disable Archive Mailbox
To disable the archive mailbox for a specific user:
Disable-Mailbox -Identity [email protected] -Archive
Conclusion
This guide provides a comprehensive overview of managing Microsoft 365 mailboxes, enabling archiving, configuring auto-expanding archives, and setting up retention policies. By following these steps, administrators can ensure efficient mailbox management and compliance with organizational data retention policies.
Note: Replace placeholders like [email protected]
, [email protected]
, and [email protected]
with actual email addresses relevant to your organization. Always test scripts in a non-production environment before applying them to live systems.
Microsoft 365 Mailbox Management and Archiving Guide
Learn how to manage Microsoft 365 mailboxes effectively with this comprehensive guide. From enabling archiving and configuring auto-expanding archives to setting up retention policies using PowerShell, this guide ensures your organization stays compliant with data management regulations.
Table of Contents
- 1. Enable Script Execution
- 2. Install and Update Required Modules
- 3. Connect to Exchange Online
- 4. Enable Archive Mailbox
- 5. Enable Auto-Expanding Archive
- 6. Check Auto-Expanding Archive Status
- 7. Configure Retention Policies
- 8. Run the Managed Folder Assistant
- 9. Check Archive Status
- 10. View Retention Policy Tags
- 11. Remove Retention Policy
- 12. Disable Archive Mailbox
1. Enable Script Execution
To run PowerShell scripts, you need to set the execution policy to RemoteSigned
. This allows you to run scripts that are created locally but requires scripts downloaded from the internet to be signed by a trusted publisher.
Set-ExecutionPolicy RemoteSigned
2. Install and Update Required Modules
To manage Microsoft 365 mailboxes, you need to install and update the necessary PowerShell modules.
Install-Module -Name ExchangeOnlineManagement
Update-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement
Install-Module MSOnline
3. Connect to Exchange Online
To manage mailboxes, you need to connect to Exchange Online using your admin credentials.
Connect-ExchangeOnline -UserPrincipalName [email protected]
To disconnect after completing your tasks:
Disconnect-ExchangeOnline
4. Enable Archive Mailbox
To enable the archive mailbox for a specific user:
Enable-Mailbox -Identity [email protected] -Archive
5. Enable Auto-Expanding Archive
For a Specific Mailbox
To enable auto-expanding archive for a specific mailbox:
Enable-Mailbox [email protected] -AutoExpandingArchive
For the Entire Organization
To enable auto-expanding archive for the entire organization:
Set-OrganizationConfig -AutoExpandingArchive
6. Check Auto-Expanding Archive Status
To check if auto-expanding archive is enabled for the organization:
Get-OrganizationConfig | FL AutoExpandingArchiveEnabled
To check the status for a specific mailbox:
Get-Mailbox [email protected] | FL AutoExpandingArchiveEnabled
7. Configure Retention Policies
Create a Retention Policy Tag
To create a retention policy tag that moves items to the archive after 1095 days (3 years):
New-RetentionPolicyTag "Bexpetro-Archive" -Type All -RetentionEnabled $true -AgeLimitForRetention 1095 -RetentionAction MoveToArchive
Create a Retention Policy
To create a retention policy and link it to the retention policy tag:
New-RetentionPolicy "Bexpetro-Archive" –RetentionPolicyTagLinks "Bexpetro-Archive"
Apply Retention Policy to a Mailbox
To apply the retention policy to a specific mailbox:
Set-Mailbox [email protected] -RetentionPolicy "Bexpetro-Archive"
8. Run the Managed Folder Assistant
The Managed Folder Assistant processes retention policies. To manually trigger it for a specific mailbox:
Start-ManagedFolderAssistant -Identity [email protected]
Alternatively, you can use the MailboxGuid
to start the assistant:
Start-ManagedFolderAssistant -Identity 77585327-1cbd-4b2d-ba51-5ed09af6b0cc
9. Check Archive Status
To check the archive status for all mailboxes:
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, ArchiveStatus
10. View Retention Policy Tags
To view all retention policy tags in your organization:
Get-RetentionPolicyTag
11. Remove Retention Policy
To remove a retention policy from a specific mailbox:
Set-Mailbox -Identity [email protected] -RetentionPolicy $null
12. Disable Archive Mailbox
To disable the archive mailbox for a specific user:
Disable-Mailbox -Identity [email protected] -Archive
Conclusion
This guide provides a comprehensive overview of managing Microsoft 365 mailboxes, enabling archiving, configuring auto-expanding archives, and setting up retention policies. By following these steps, administrators can ensure efficient mailbox management and compliance with organizational data retention policies.
Note: Replace placeholders like [email protected]
, [email protected]
, and [email protected]
with actual email addresses relevant to your organization. Always test scripts in a non-production environment before applying them to live systems.