Delete an inactive mailbox in Office 365

An inactive mailbox is used to preserve a former employee's email after he or she leaves your organization. When you no longer need to preserve the contents of an inactive mailbox, you can permanently delete the inactive mailbox by removing the hold. Also, it's possible that multiple holds might be placed on an inactive mailbox. For example, an inactive mailbox might be placed on Litigation Hold and on one or more In-Place Holds. Additionally, an Office 365 retention policy (created in the Office 365 Security & Compliance Center) might be applied to the inactive mailbox. You have to remove all holds and Office 365 retention policies from an inactive mailbox to delete it. After you remove the holds and retention policies, the inactive mailbox is marked for deletion and is permanently deleted after it's processed.

Important: We've postponed the July 1, 2017 deadline for creating new In-Place Holds to make a mailbox inactive. But later this year or early next year, you won't be able to create new In-Place Holds in Exchange Online. At that time, only Litigation Holds and Office 365 retention policies can be used to create an inactive mailbox. However, existing inactive mailboxes that are on In-Place Hold will still be supported, and you can continue to manage the In-Place Holds on inactive mailboxes. This includes changing the duration of an In-Place Hold and permanently deleting an inactive mailbox by removing the In-Place Hold.

See the More information section for a description of what happens after holds are removed from an inactive mailbox.

Before you begin

You have to use Exchange Online PowerShell to remove a Litigation Hold from an inactive mailbox. You can't use the Exchange admin center (EAC). For step-by-step instructions, see Connect to Exchange Online PowerShell. You can use Exchange Online PowerShell or the EAC to remove an In-Place Hold from an inactive mailbox.

If you remove the hold or Office 365 retention policy from an inactive mailbox and the soft-deleted mailbox retention period for the mailbox has expired, the mailbox will be permanently deleted. After it's deleted, it can't be recovered. Before you remove the hold, be sure that you no longer need the contents in the mailbox. If you want to re-activate an inactive mailbox, you can recover it. For details, see Recover an inactive mailbox in Office 365.

The value of True for the LitigationHoldEnabled property indicates that the inactive mailbox is on Litigation Hold. If an In-Place Hold is placed on an inactive mailbox, the GUID for the hold is displayed as the value for the InPlaceHolds property. For example, the following results for two inactive mailboxes show that a Litigation Hold is placed on Ann Beebe and that two In-Place Holds are placed on Pilar Pinilla.

Tip: If a lot of In-Place Holds are placed on an inactive mailbox, not all of the In-Place Hold GUIDs will be displayed. You can run the following command to display all the In-Place Hold GUIDs: Get-Mailbox -InactiveMailboxOnly -Identity <identity of inactive mailbox> | Select-Object -ExpandProperty InPlaceHolds

Step 2: Remove a hold from an inactive mailbox

After you identify what type of hold is placed on the inactive mailbox (and whether there are multiple holds), the next step is to remove the holds on the mailbox. As previously stated, you have to remove all holds to permanently delete an inactive mailbox.

Remove a Litigation Hold

As previously stated, you have to use Windows PowerShell to remove a Litigation Hold from an inactive mailbox. You can't use the EAC. Run the following command to remove a Litigation Hold.

Tip: The best way to identify an inactive mailbox is by using its Distinguished Name or Exchange GUID value. Using one of these values helps prevent accidentally specifying the wrong mailbox.

Remove In-Place Holds

There are two ways to remove an In-Place Hold from an inactive mailbox:

Delete the In-Place Hold object If the inactive mailbox that you want to permanently delete is the only source mailbox for an In-Place Hold, you can just delete the In-Place Hold object.

Note: You have to disable the hold before you can delete an In-Place Hold object. If you try to delete an In-Place Hold object that has the hold enabled, you'll receive an error message.

Remove the inactive mailbox as a source mailbox of an In-Place Hold If you want to retain other source mailboxes for an In-Place Hold, you can remove the inactive mailbox from the list of source mailboxes and keep the In-Place Hold object.

Use the EAC to delete an In-Place Hold

If you know the name of the In-Place Hold that you want to delete, you can go to the next step. Otherwise, run the following command to get the name of the In-Place Hold that is placed on the inactive mailbox that you want to permanently delete. Use the In-Place Hold GUID that you obtained in Step 1.

Get-MailboxSearch -InPlaceHoldIdentity <In-Place Hold GUID> | FL Name

In the EAC, go to Compliance management > In-Place eDiscovery & Hold.

Select the In-Place Hold you want to delete, and then click Edit
.

On the In-Place eDiscovery & Hold properties page, click In-Place Hold, uncheck the Place content matching the search query in selected mailboxes on hold box, and then click Save.

Use the EAC to remove an inactive mailbox from an In-Place Hold

If you know the name of the In-Place Hold that's placed on the inactive mailbox, you can go to the next step. Otherwise, run the following command to get the name of the In-Place Hold placed on the mailbox. Use the In-Place Hold GUID that you obtained in Step 1.

Get-MailboxSearch -InPlaceHoldIdentity <In-Place Hold GUID> | FL Name

In the EAC, go to Compliance management > In-Place eDiscovery & Hold.

Select the In-Place Hold that is placed on the inactive mailbox, and then click Edit
.

On the In-Place eDiscovery & Hold properties page, click Sources.

In the list of source mailboxes, click the name of the inactive mailbox that you want to remove, and then click Remove
.

Click Save to save the change. A message is displayed saying the operation was successfully completed.

Repeat steps 1 through 6 to remove other In-Place Holds placed on the inactive mailbox.

Use Exchange Online PowerShell to remove an inactive mailbox from an In-Place Hold

If the In-Place Hold contains a large number of source mailboxes, it's possible the inactive mailbox won't be listed on the Sources page in the EAC. Up to 3,000 mailboxes are displayed on the Sources page when you edit an In-Place Hold. If an inactive mailbox isn't listed on the Sources page, you can use Exchange Online PowerShell to remove it from the In-Place Hold.

Create a variable that contains the properties of the In-Place Hold placed on the inactive mailbox. Use the In-Place Hold GUID that you obtained in Step 1.

Verify that the inactive mailbox is listed as a source mailbox for the In-Place Hold.

$InPlaceHold.Sources

Note: The Sources property of the In-Place Hold identifies the source mailboxes by their LegacyExchangeDN properties. Because this property uniquely identifies inactive mailboxes, using the Sources property from the In-Place Hold helps prevent removing the wrong mailbox. This also helps to avoid issues if two mailboxes have the same alias or SMTP address.

Remove the inactive mailbox from the list of source mailboxes in the variable. Be sure to use the LegacyExchangeDN of the inactive mailbox that's returned by the command in the previous step.

$InPlaceHold.Sources.Remove("<LegacyExchangeDN of the inactive mailbox>")

For example, the following command removes the inactive mailbox for Pilar Pinilla.

More information

An inactive mailbox is a type of soft-deleted mailbox. In Exchange Online, a soft-deleted mailbox is a mailbox that's been deleted but can be recovered within a specific retention period. The soft-deleted mailbox retention period in Exchange Online is 30 days. This means that the mailbox can be recovered within 30 days of being soft-deleted. After 30 days, a soft-deleted mailbox is marked for permanent deletion and can't be recovered.

What happens after you remove the hold on an inactive mailbox? The mailbox is treated like other soft-deleted mailboxes and is marked for permanent deletion after the 30-day soft-deleted mailbox retention period expires. This retention period starts on the date when the mailbox was first made inactive. This date is known as the soft-deleted date, which is the date the corresponding Office 365 user account was deleted or when the Exchange Online mailbox was deleted with the Remove-Mailbox cmdlet. The soft-deleted date isn't the date on which you remove the hold.

Is an inactive mailbox permanently deleted immediately after the hold is removed? If the soft-deleted date for an inactive mailbox is older than 30 days, the mailbox won't be permanently deleted as soon as you remove the hold. The mailbox will be marked for permanent deletion and is deleted the next time it’s processed.

How does the soft-deleted mailbox retention period affect inactive mailboxes? If the soft-deleted date for an inactive mailbox is more than 30 days before the date the hold was removed, the mailbox is marked for permanent deletion. But if an inactive mailbox has a soft-deleted date within the last 30 days and you remove the hold, you can recover the mailbox up until the soft-deleted mailbox retention period expires. For details, see Delete or restore user mailboxes in Exchange Online. After the soft-deleted mailbox retention period expires, you have follow the procedures for recovering an inactive mailbox. For details, see Recover an inactive mailbox in Office 365.

How do you display information about an inactive mailbox after the hold is removed? After a hold is removed and the inactive mailbox is reverted back to a soft-deleted mailbox, it won't be returned by using the InactiveMailboxOnly parameter with the Get-Mailbox cmdlet. But you can display information about the mailbox by using the Get-Mailbox -SoftDeletedMailbox command. For example:

Note the WhenSoftDeleted property that identifies the soft-deleted date, which in this example is October 30, 2014. If this soft-deleted mailbox was previously an inactive mailbox for which the hold was removed, it will be permanently deleted 30 days after the value of the WhenSoftDeleted property. In this case, the mailbox is permanently deleted after November 30, 2014.