Manage inactive mailboxes in Exchange Online

In this article you will learn how to manage inactive mailboxes in Exchange Online. You will learn what is inactive mailbox, how to restore inactive mailbox, and how to delete inactive mailbox.

What is Exchange Online inactive mailbox

Exchange Online inactive mailbox is a mailbox that is preserved for a certain period of time after a user account is deleted. This feature allows organizations to retain mailbox data for compliance, legal, or operational reasons, even after the user account associated with the mailbox is no longer active.

When a user account associated with a mailbox is deleted, and the mailbox is under Litigation Hold or Retention Hold (Microsoft Purview), Exchange Online preserves the corresponding mailbox as an inactive mailbox. The mailbox data remains accessible to administrators for a specified retention period, during which it can be recovered if needed. After the retention period expires, the inactive mailbox and its data are permanently deleted or action is taken as per the defined action within Retention Policies in Microsoft Purview.

Important: When a mailbox is kept under litigation hold or a retention policy (Microsoft Purview) is applied, and if an administrator will delete this mailbox, the mailbox will be moved to inactive mailbox state.

What is Litigation hold Office 365

In Office 365, Litigation Hold is a feature that allows organizations to preserve emails and other mailbox content. When Litigation Hold is enabled for a user’s mailbox, any items (such as emails, calendar entries, tasks, etc.) that are deleted by the user are retained for the duration specified while enabling litigation hold. Administrators can run Content Search or e-Discovery search to find content of these mailboxes.

If an administrator deletes a mailbox that has litigation applied, the mailbox is retained in inactive mailboxes state for the duration specified within the litigation hold duration.

Important: If a user deletes emails from his mailbox that has litigation hold applied, the emails are retained in the Purges folder of the Recoverable Items folder of the mailbox. Administrators can run Get-MailboxFolderStatistics -Identity “UserName” | Select-Object Name,ItemsInFolder,FolderSize,folderpath PowerShell command or can use MFCMAPI tool to check purges folder of the mailbox.

Get inactive mailbox using PowerShell

As an administrator you can not view inactive mailboxes using Exchange Admin Center (EAC). To get inactive mailbox in Exchange Online, you need to run below PowerShell command. Make sure you are connected to Exchange Online module (Connect-ExchangeOnline) before you run below PowerShell commands.

PowerShell
Get-Mailbox -InactiveMailboxOnly | Select-Object DisplayName,PrimarySmtpAddress

The above command will list all the inactive mailboxes as shown below:

Get inactive mailbox using PowerShell

If you want to list a particular inactive mailbox, run below PowerShell command:

PowerShell
Get-Mailbox -Identity "[email protected]" -InactiveMailboxOnly

How to restore inactive mailbox

As an administrator you can come across scenarios where a new user in your organization wants access to the inactive mailbox content, you can restore inactive mailbox content to the new user’s mailbox. You can also restore the content of archive mailbox.

To restore inactive mailbox content to another mailbox, follow below steps:

In this example, you will copy the content of the inactive mailbox (source mailbox) to an active mailbox (target mailbox).

First we will collect ExchangeGuid value for both the mailboxes (source and target). To collect ExchangeGuid for the inactive mailbox (source mailbox), run below PowerShell command:

PowerShell
Get-Mailbox -Identity "Inactive Mailbox Name" -InactiveMailboxOnly | Select-Object *ExchangeGuid*

To collect ExchangeGuid value for the active mailbox (target mailbox), run below PowerShell command:

PowerShell
Get-Mailbox -Identity "Active Mailbox Name" | Select-Object *ExchangeGuid*

To copy content of the source mailbox and paste it to the target mailbox, run below PowerShell command:

PowerShell
New-MailboxRestoreRequest -SourceMailbox "Inactive Mailbox Exchange Guid" -TargetMailbox "Active Mailbox Exchange Guid" -AllowLegacyDNMismatch

The actual PowerShell command will look like below:

PowerShell
New-MailboxRestoreRequest -SourceMailbox "06a39d92-6625-4f5e-b3a1-8de4a5380649" -TargetMailbox "6657d23e-ee10-4e19-9ff2-42a21e1f7ee2" -AllowLegacyDNMismatch

The above command will start a mailbox restore request job as shown below:

New-MailboxRestoreRequest

To check the status of the mailbox restore request job, we will run below PowerShell command:

PowerShell
Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics

The PowerShell command Get-MailboxRestoreRequest | Get-MailboxRestoreRequestStatistics will list all the mailbox restore request jobs, and it will show if the mailbox restore request is completed or still running as shown below:

Get

Important: Once the mailbox restore request is completed, the source mailbox will still be preserved in inactive mailbox state.

Restore inactive mailbox archive

If an inactive mailbox has an archive mailbox, you can also restore it to the archive mailbox of an existing mailbox. To restore the archive from an inactive mailbox, we will use New-MailboxRestoreRequest PowerShell command along with the SourceIsArchive and TargetIsArchive switches.

First, we will collect inactive mailbox properties in a variable. Replace “[email protected]” with the actual email address of the inactive mailbox, and run below PowerShell command:

PowerShell
$InactiveMailbox = Get-Mailbox -InactiveMailboxOnly -Identity "[email protected]"

Next, we will copy the content from the archive of inactive mailbox (source mailbox) to an active mailbox (target mailbox).

PowerShell
New-MailboxRestoreRequest -SourceMailbox $InactiveMailbox.ExchangeGuid -SourceIsArchive -TargetMailbox "[email protected]" -TargetIsArchive -TargetRootFolder "Inactive Mailbox Archive"

The above command will copy the content from archive of inactive mailbox “User1” to the “Inactive Mailbox Archive” folder of the target mailbox “User2”.

Conclusion

In this article you learnt what is inactive mailbox, how to restore inactive mailbox, and how to restore inactive mailbox archive content.

You might like our other articles on Delete mailbox in Exchange Online, Manage Office 365 users using Graph PowerShell.

If you found this article helpful and informative, please share it within your community and do not forget to share your feedback in the comments below.

Join us on YouTube for the latest videos on the Cloud technology and join our Newsletter for the early access of the articles and updates.

Happy Learning!!