Dela via


Enable or disable single item recovery for a mailbox in Exchange Online

You can use Exchange Online PowerShell to enable or disable single item recovery on a mailbox. In Exchange Online, single item recovery is enabled by default when a new mailbox is created. In Exchange Server, single item recovery is disabled when a mailbox is created. If single item recovery is enabled, messages that are permanently deleted (purged) by the user are retained in the Recoverable Items folder of the mailbox until the deleted item retention period expires. This lets an administrator recover messages purged by the user before the deleted item retention period expires.

What do you need to know before you begin?

Having problems? Ask for help in the Exchange forums. Visit the forums at Exchange Online or Exchange Online Protection.

Use Exchange Online PowerShell to enable single item recovery

This example enables single item recovery for the mailbox of April Summers.

Set-Mailbox -Identity "April Summers" -SingleItemRecoveryEnabled $true

This example enables single item recovery for the mailbox of Pilar Pinilla and sets the number of days that deleted items are retained to 30 days.

Set-Mailbox -Identity "Pilar Pinilla" -SingleItemRecoveryEnabled $true -RetainDeletedItemsFor 30

This example enables single item recovery for all user mailboxes in the organization.

Get-Mailbox -ResultSize unlimited -Filter "RecipientTypeDetails -eq 'UserMailbox'" | Set-Mailbox -SingleItemRecoveryEnabled $true

This example enables single item recovery for all user mailboxes in the organization and sets the number of days that deleted items are retained to 30 days

Get-Mailbox -ResultSize unlimited -Filter "RecipientTypeDetails -eq 'UserMailbox'" | Set-Mailbox -SingleItemRecoveryEnabled $true -RetainDeletedItemsFor 30

For detailed syntax and parameter information, see Set-Mailbox.

Use Exchange Online PowerShell to disable single item recovery

You might need to disable single item recovery for a user's mailbox. For example, before you can permanently delete content from a mailbox, you have to disable single item recovery.

This example disables single item recovery for the mailbox of Ayla Kol.

Set-Mailbox -Identity "Ayla Kol" -SingleItemRecoveryEnabled $false

How do you know this worked?

To verify that you've enabled single item recovery for a mailbox and display the value for how long deleted items will be retained (in days), run the following command.

Get-Mailbox <Name> | Format-List SingleItemRecoveryEnabled,RetainDeletedItemsFor

You can use this same command to verify that single item recovery is disabled for a mailbox.

More information

  • To learn more about single item recovery, see Recoverable Items folder in Exchange Online. To recover messages purged by the user before the deleted item retention period expires, see Recover deleted messages in a user's mailbox.

  • If a mailbox is placed on In-Place Hold or Litigation Hold, messages in the Recoverable Items folder are retained until the hold duration expires. If the hold duration is unlimited, then items are retained until the hold is removed or the hold duration is changed.