In this post, we will discuss Document Deletion Policies in Office 365 SharePoint Online. What are Document Deletion Policies in Office 365 and how we can create document deletion policy as well as how we can implement the document deletion policy in a site collection?
In lots of enterprises one common requirement comes as to store documents for a specific period of time and after that, the document should get deleted. SharePoint Online provides this document deletion policy feature which will help to achieve this kind of requirement. It will delete documents from the site after a specific period of time. Not only from SharePoint site, it also deletes documents from user’s OneDrive for Business sites.
Previously SharePoint provides Records management and Information management policies which are helpful to deal with structured data. Document deletion policies help in the automatic deletion of unstructured data such as OneDrive for Business sites and team sites.
Also, you can read:
– SharePoint 2016 Fast Site Collection Creation using PowerShell
– Assign A Task Action in Nintex Workflow for Office 365 SharePoint online
Below are a few points we should remember in document deletion policies:
– As the name suggest document deletion policies work only for document libraries not with list.
– Three main components in this: Policies, Rules and Site Collections
We can create single or multiple policies. We can add single or multiple rules to a single document deletion policy. And then we can assign a policy to a site collection template (like team site template) or to a single site collection also. When you assign a document deletion policy to a site collection template, then the policy will be available to all site collections created from that template.
– Apart from this you can also create a single policy and make it mandatory. Then the policy can be assigned to all sites in the site collection.
– Document deletion policies are inherited meaning if a site owner selects a document deletion policy for their site then all the subsites will inherit the policy from the parent. But site owner can anytime break the inheritance and can apply a different policy.
– Whenever you apply a document deletion policy, you should remember that the time period depends on the document was created or modified, not the time since the policy was assigned. When you assign the policy for the first time, all documents in the site are evaluated and, if they meet the criteria, they will be deleted. This applies to all existing documents, not just new documents created since the policy was assigned.
– Another point to remember is that A site collection or a site collection template can have one or more policies assigned to it, and each of those policies can have one or more rules. But there can be only one policy can active per site and there can be only one deletion rule that’s active at any time for the libraries within the site. Check a very good fig like below:
Create Document Deletion Policies:
There two ways you can create open Document Deletion Policy Center:
From Office 365 Security & Compliance:
Login to your Office 365, then from App launcher click on “Security & Compliance Center”. Then from the left navigation, click on “Data management” and then click on Retention. Then from the Retention, click on “Manage document deletion policies for SharePoint Online and OneDrive for Business”. First time when you click on this link it will create the Document Deletion Policy Center automatically.
Office 365 Document Deletion Policies in Office 365 SharePoint Online and how to create and implement document deletion policy in Site CollectionFrom Create New Site Template:
The other way we can create a Document Deletion Policy Center is Login to Office 365, then go to SharePoint administration. There create a new site collection and then choose “Compliance Policy Center” template which is under the Enterprise tab as shown in the fig below:
Then in the Compliance Policy Center, click on Deletion Policies like below:
This will open the Deletion Policies library which will have two default Policies. Click on New item to create a new policy.
Here in the New Deletion Policy page, give a Policy Name, and Description.
Then click on +New button to add a new rule to the policy. Here give a name for the rule. Either you can delete an item to recycle bin or you can permanently delete the item. Here I have chosen Delete to Recycle Bin option.
Date from when the document deletion date will be calculated, in this case, choose either Last Modified Date or Created date. Whatever option you will choose, the time period calculation will be done based on this option.
The time period after which the document will be deleted: Here you can add Years, Months or Days. Lets us say if you want to delete documents whose last modified date before 2 months, then you can add 2 in the textbox and then select Months from the drop down.
Also, you can Set as default rule check box to make this rule as a default rule.
Once you Save the rule, the policy will look like below:
Then click on Save to Save the Policy. It will reflect in the Deletion Policies library. You can see now 3 policies.
Assign Deletion Policies to Site Collection Templates:
Now we will assign the policy to a site collection template. So that the Deletion Policy will be available to all site collections created from the same template.
In the Document Deletion Policy Center, click on “Policy Assignment for Templates” link and then click on +new item in “Policy Assignments for Templates” library like below:
Then in the New Template Assignment, first click on “First choose a template” button as shown in the fig below:
Here either you can choose from OneDrive for Business Template or You can choose from Site Collection template. Then I am choosing here for Team Site template. So any site collection using Team site template will have this Policy.
Then assign the rule which we have created in the previous steps like below:
Now you will look at the New Template Assignment, the screen looks like below. Where we have choosen the Template, Rule. And also if you want to make this rule as mandatory, then check the checkbox “Make Policy as Mandatory” like below:
Assign Policy To Site Collection:
Now we will discuss how we can assign Document Deletion Policy to site collections. From the “Document Deletion Policy Center” site, click on “Policy Assignments for Site Collections” link as which will open “Policy Assignments for Site Collections” document library. Here click on +new items as shown in the fig below:
Then in the “New: Site Collection Assignment” page click on “First choose a site collection” link. This will open Choose a site collection dialog box. Here search for your site collection as shown in the fig below:
Then click on OK. Then assign the rule as shown in the fig below, and also if you want to make the policy as mandatory, then check the checkbox “Mark Policy as Mandatory” as shown in the fig below:
Check Policy in Site Collection:
Now we can the Policy in the site collection. Go back to your Office 365 SharePoint Online site collection. Click on the gear icon and then click on Site settings. This will open the Site settings page. Click on “Document Deletion Policies” which is under Site Collection Administration.
If you will not be able to see this link, wait till 24 hours, it should be visible. For me, it came in 2 hours. It should look like below:
The policy will appear like below:
Office 365 Document Deletion Policies in Office 365 SharePoint Online and how to create and implement document deletion policy in Site CollectionHope this will be helpful.
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.