Many people are unaware of the fact that ALL (yes, I said ALL) Exchange Online plans are configured by default, to ONLY retain deleted items for 14 days. Yes, I said ALL Exchange Online plans, and I quote:
“How long deleted items are kept in the Deletions folder depends on the deleted item retention period that is set for the mailbox. An Exchange Online mailbox keeps deleted items for 14 days, by default. Use the Exchange Management Shell, as shown above, to change this setting, to increase the period up to a maximum of 30 days.”
this is from:
You will also note that you can extend this to a maximum of 30 days using PowerShell, which is exactly what you should do IMMEDIATLY you add a user account I would suggest.
To do this you firstly need to connect to Exchange Online using PowerShell. Then to view the current retention periods run the following:
that should then display something like:
As you can see from the above, all the mailboxes listed are currently only set to a MAXIMUM of 14 days for retention (which is the default).
To extend this to the maximum of 30 days for ALL plans, execute the following command:
Now when you re-examine all the deletion period for all mailboxes you should see:
they have all been extended to the maximum of 30 days, which should make everyone much happier and provide you the ability to recovered deleted email data out to the maximum period of 30 days for ALL plans. After 30 days however, the deleted data will still be purged and unrecoverable.
If you wish to retain deleted email data beyond the maximum 30 days that can be provisioned generally you’ll need to add the legal hold service to the mailbox and ENABLE it! The legal hold service is available on Exchange Online Plan 2 mailboxes, E3 and E5 suites typically.
To my way of thinking, extending the deleted item retention period of all mailboxes in a tenant is something that should be done immediately and using the above PowerShell commands it is really easy to do. So there should be NO excuse!
3 thoughts on “Extending Exchange Online Deleted Items retention period”
Thank you for all these articles!
If you do
Get-Mailbox | Set-Mailbox -RetainDeletedItemsFor 30
then create a new mailbox, they will be set to 14 days,correct?
Is there a way to change it from 14 to 30 for the tenant for existing and future mailboxes?
Or just add this command to the list of things you do for new users?
And this command is as good as specifiying only the newly created mailbox – it will simply make sure all the other mailboxes are set to 30, including recently created ones you forgot to run this command on?
>>then create a new mailbox, they will be set to 14 days,correct?
No, command only does current mailboxes.
>>Is there a way to change it from 14 to 30 for the tenant for existing and future mailboxes?
No. New mailboxes need this set upon creation.
>>Or just add this command to the list of things you do for new users?
>> it will simply make sure all the other mailboxes are set to 30, including recently created ones you forgot to run this command on?
If someone is interested ;
The global configuration for the deleted items retention period is stored in the Mailbox Plans assigned to users.
Get-MailboxPlan | ft Name, RetainDeletedItemsFor
In order to configure it, you can use the Set-MailboxPlan cmdlet:
Get-MailboxPlan | Set-MailboxPlan -RetainDeletedItemsFor “30.00:00:00”
This will apply the settings to all new users; however, you’ll still need to modify it for existing users:
Get-Mailbox | Set-Mailbox -RetainDeletedItemsFor “30.00:00:00”