Exchange Online: Inactive Mailboxes

As part of a recent Exchange 2007 to Exchange Online migration (staged method), I needed to move some leaver mailboxes to Exchange Online.

The customer needed to keep these for compliance reasons, but obviously didn’t want to have to apply licenses to the mailboxes.

I decided to use the inactive mailboxes feature of Exchange Online.

Inactive Mailboxes

With inactive mailboxes, email data is retained when the corresponding user account is deleted from Office 365.  Retention can be for a specified duration (in days), or indefinitely.

Inactive mailboxes don’t receive mail or appear in Exchange Address Lists.

Email data can be retrieved from inactive mailboxes via the following methods:

  • Content Search in the Office 365 Security & Compliance Center: the contents of the inactive mailbox can be searched and exported.
  • Inactive mailboxes can be recovered (converted) to a new mailbox.  The folder structure and contents are retained, and the mailbox is linked to a new user account.  It no longer exists as an inactive mailbox.
  • Inactive mailboxes can be restored (merged) into another mailbox.  The content is copied to another mailbox.  It continues to exist as an inactive mailbox.

Creating Inactive Mailboxes

Both of the following steps must be completed, in this order, for an inactive mailbox to be created.

  1. The mailbox must be placed on Litigation Hold or have an Office 365 retention policy applied to it.
  2. The mailbox needs to be deleted, the preferred (and cleanest) way of doing this is to delete the corresponding user account from Office 365.

I placed the mailboxes on Litigation Hold, this can be done using the Office 365 Exchange Admin Center, or via PowerShell.

Via the Office 365 Exchange Admin Center

Select the mailbox to be placed on Litigation Hold, then click Edit.


Click mailbox features.

Litigation hold is disabled.  Under Litigation hold: Disabled, click Enable.


Litigation hold duration (days): I want the email data to be retained indefinitely, so I’ve left this value blank.  Duration is based on the date a mailbox item is received or created.

Note: this will appear in the user’s mailbox notifying them that their mailbox is on Litigation Hold.  Outlook 2010 onwards.

URL: this can be used to provide the user with a website to go to for further information.  Again, Outlook 2010 onwards.

Click Save.


Litigation hold is now enabled.  Click Save.


Accept the  warning: “The hold setting may take up to 60 minutes to take effect”.  Click OK.


If you click on View details, you’ll see the date litigation hold was enabled, and which admin user placed the mailbox on litigation hold.


Note litigation hold can only be enabled on one mailbox at a time in the Exchange Admin Center, you cannot perform a bulk user operation.

Via PowerShell

Connect to Exchange Online with PowerShell (see here).

The following command puts the mailbox on litigation hold indefinitely.

Set-Mailbox [Identity] -LitigationHoldEnabled $true

For example:

Set-Mailbox -LitigationHoldEnabled $true


To specify a litigation hold duration, use -LitigationHoldDuration [Days].

Set-Mailbox [Identity] -LitigationHoldEnabled $true -LitigationHoldDuration 1825

Litigation hold properties can be reviewed with the following command.

Get-Mailbox [Identity] | fl LitigationHold*,

For example:

Get-Mailbox | fl LitigationHold*


To apply litigation hold to multiple mailboxes based on an input CSV file, create a CSV input file (mine is SetLitHold.csv) with the header EmailAddress, e.g.


Read the CSV file into a variable:

$CSVInput = Import-CSV SetLitHold.csv

Enable litigation hold:

$CSVInput | ForEach {
Set-Mailbox $_.EmailAddress -LitigationHoldEnabled $true









Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s