Changing Office 365 Deleted Items Retention

I had a lot of difficulty changing the deleted items retention in Office 365 Exchange from the default 14 days to 30. I would change it but it still showed as 14 days. Finally at the suggestion of Microsoft Office 365 Support, I removed the retention, then re-added it. Finally it showed the correct value.

Here are the PowerShell commands that worked to change deleted items retention for one account:

Get-mailbox | fl name, UseDatabaseRetentionDefaults, RetainDeletedItemsFor
Set-Mailbox -UseDatabaseRetentionDefaults $False
Set-Mailbox -RetainDeletedItemsFor 30
Get-mailbox | fl name, UseDatabaseRetentionDefaults, RetainDeletedItemsFor

If you know you need UseDatabaseRetentionDefaults $true, you can probably re-enable that afterwards, but since only one mailbox had that set to $true, after changing it to $false, I left it alone.

This 2014 article confirms the conflict if UseDatabaseRetentionDefaults is $true:

3 thoughts on “Changing Office 365 Deleted Items Retention

  1. Mark Berry Post author

    @Rick, it’s confusing, but here is how I understand it:

    There are two folders in question. The visible Deleted Items folder and the hidden Recoverable Items folder. When you delete an item from Deleted Items, it moves to Recoverable Items.

    The Q&A at the bottom of the article you cite states, “No the change does not apply to the Recoverable Items folder. It is only for the visible Deleted Items folder.” So this MRM policy is about the VISIBLE folder only. By default, you can now leave stuff in Deleted Items indefinitely (not a good idea in my opinion, but I guess some users work that way).

    If and only if you delete an item from Deleted Items (or Empty the Deleted Items folder, as I do daily), the “permanently deleted” items are recoverable for a short while, 14 days by default, or up to 30 days if you use the Powershell commands in the article above.

    I think there is a way to move items from Recoverable Items to the Archive but I’m not doing that. Basically I want my deleted stuff to have a 30-day Undo option, then to disappear.

  2. Rick

    OK, thanks for clarifying. Yes, very tricky indeed, especially when MS uses a term like “RetainDeletedItemsFor” when they might have better named it “RetainRecoverableItemsFor.”

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.

This site uses Akismet to reduce spam. Learn how your comment data is processed.