Dela via


Change how long permanently deleted items are kept for an Exchange Online mailbox

If you've permanently deleted an item in Microsoft Outlook or Outlook on the web (formerly known as Outlook Web App), the item is moved to a folder (Recoverable Items > Deletions) and kept there for 14 days, by default. You can change how long items are kept, up to a maximum of 30 days.

What do you need to know before you begin?

Change how long permanently deleted items are kept

In these examples, we increase the retention period to 30 days, the maximum for Exchange Online mailboxes. But you can set the number to whatever you like, up to that limit.

Example 1: Set Emily Maier's mailbox to keep deleted items for 30 days. In Exchange Online PowerShell, run the following command.

Set-Mailbox -Identity "Emily Maier" -RetainDeletedItemsFor 30

Example 2: Set all user mailboxes in the organization to keep deleted items for 30 days. In Exchange Online PowerShell, run the following command.

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

Need more details about using these commands? See Exchange Online PowerShell Help article Set-Mailbox.

Note

These commands only apply to existing mailboxes and will not affect new mailboxes that you create in the future. To change this setting on all new mailboxes, use a mailbox plan that has a new retention policy that applies to new mailboxes. See Mailbox plans and Set-MailboxPlan for more information.

More about deleted items and retention time

When a user permanently deletes a mailbox item (such as an email message, a contact, a calendar appointment, or a task) in Microsoft Outlook and Outlook on the web, the item is moved to the Recoverable Items folder, and into a subfolder named Deletions.

A mailbox item is deleted and moved to the Recoverable Items folder when a user does one of the following:

  • Deletes an item from the Deleted Items folder

  • Empties the Deleted Items folder

  • Permanently deletes an item by selecting it and pressing Shift+Delete

Users can recover, or purge, deleted items before the retention time for a deleted item expires. To do so, they use the Recover Deleted Items feature in Outlook or Outlook on the web. See the following articles for Outlook for Windows or for Outlook on the web.

To learn more about deleted item retention, the Recoverable Items folder, In-Place Hold, and Litigation Hold, see Recoverable Items folder in Exchange Online.