How to Create a Retention Policy to Preserve Deleted Items in SharePoint Online?

Requirement: Create retention policy to preserve deleted items in SharePoint Online.

How to Create a Retention Policy for SharePoint Online?
SharePoint Online retains deleted items for 93 days before they gets deleted permanently. What if you want to preserve deleted items more than 93 days? Say, for 10 years as per your compliance regulatory policies or legal requirements? Well, Office 365 retention polices gives us the ability to retain and recover deleted items and files. You can preserve deleted files with the help of retention policies in Office 365 compliance center. Basically, You have to create a retention policy and apply it to areas like SharePoint, OneDrive, etc. Here is how to create a retention policy in Office 365 compliance center:
  • Login to Microsoft Admin center at https://admin.microsoft.com as global administrator >> Open "Compliance Center" https://compliance.microsoft.com link from the left navigation.
  • In the Compliance Center, Click on "Policies" from the left navigation >> Choose "Retention" >> Click on "New retention policy".
  • Provide a name to your policy and optionally the description. E.g. "Retain Deleted items for 10 years".
    create retention policy
  • We can use these policies to either preserve or remove items, We've also options like the retention policy based on the creation date or the last modified date. Here in my case, I've selected to retain deleted content for 10 years and not to delete the content automatically.
    retention policy settings
  • Choose locations to preserve such as SharePoint Online and OneDrive for Business.You can apply the policy globally or to specific site collections.
    choose locations for preservation

  • Review your settings and then click on "Create this Policy" button to create the policy.
  • Wait till the status of the Policy changes from "On (Pending)" to "On (Success) ". Although the compliance center tells us, it may take up to 24 hours to apply the policy, it actually depends on the volume of your content. It took me 10 minutes to activate the policy in my case.
    office 365 compliance policy status

SharePoint Online Retention Policy in Action:
Once the retention policy is applied to your SharePoint Online site(s), You'll see below changes:
  • You'll see a new library "Preservation Hold Library" in site contents page as soon as you delete any item or edit an existing item for the first time. (This library is visible only to Site collection administrators!). You can recover deleted items from it.
  • If you try to delete a list or library that has content, you'll see an error message "List cannot be deleted while on hold or retention policy."
  • You can't delete a folder with its contents! If you try, you'll face "You have to delete all the items in this folder before you can delete the folder." error! You can either use Explorer view or PowerShell to delete all files in a folder recursively.
  • You can't delete a site collection from Admin center (or even with PowerShell!). You must exclude the site from retention policy in order to delete the site.

When a list item or a document is deleted in SharePoint, to goes to the recycle bin and a copy of the item is send to the preservation hold library! Also, a copy of the original content is retained in the Preservation Hold library when users edit existing documents (that are created prior to applying the policy!).


Storage Consumption by the SharePoint Retention Policies:
When a retention policy is active, SharePoint keeps copies of deleted or changed documents in the "Preservation Hold Library" and starts consuming the storage quota. So, when users edits and deletes lot of files,  the versions build up and you can expect higher storage consumption.

1 comment:

  1. Thanks, your article helped to solve my requirement!

    ReplyDelete

Please Login and comment to get your questions answered!

Powered by Blogger.