How to set up document retention via retention labels in SharePoint and OneDrive
I recently blogged on how to set up retention policies on a SharePoint site. However, that process assumed you have the same retention requirements for all the content on the site. Too often, this is not the case. You might have some documents that need to be retained forever, while some that need to be retained just for a few years. In this case, you would need to individually assign document retention via retention labels in SharePoint (Office 365 to be precise).
With this post, I would like to explain to you how to set up such retention labels, as well as corresponding label retention policies, and publish them to specific sites in SharePoint.
NOTE: As of the writing of this post, Microsoft is splitting the Office 365 Security & Compliance Center into two separate centers: Office 365 Security Center and Office 365 Compliance Center. While my previous blog post on retention mentions the outgoing Office 365 Security & Compliance Center, for this post, I am using the new Compliance Center, so hopefully, instructions for this article and images will be relevant for years to come.
3 Steps to set up document retention via retention labels
There are three steps involved when it comes to setting up document retention via retention labels in SharePoint.
- Create Retention Labels (specify the retention period)
- Create and Publish Retention Policies (specify which sites the retention labels will be applied to)
- Label (tag) the content with Retention Labels
STEP 1: Create Retention Labels
With this step, all we are doing is specifying what the retention period will be for documents that will eventually be tagged with the label.
- Navigate to the New Compliance Center in Office 365: https://compliance.microsoft.com
- Click on Show all to expand all of the features
- Click on Information Governance
- You will now see the area that shows all the existing retention labels. I already have a few created, if this is a first time accessing it – it will be blank
- Click on Create a label to create a new retention label
- Create the label name as well as a description, click Next. NOTE: Description for users text will come in handy later when the user tags the document as it will provide additional context/information on what will happen to items tagged with the label. Don’t skip it!
- On the next screen, toggle the Retention switch to On
- Once you toggle above switch to On, you will find the options to set up the retention label. In the first step, you can specify the retention period. Typically, you will keep the content for years, but you can also specify days or months. Since I am doing this here for this demo/tutorial and don’t feel like waiting for seven years for results, I am setting this up to retain content for just two days (because in 7 years I plan to win a lottery and live on a paradise island somewhere) :-)
- Next, you need to specify what you want to do with the content at the end of the retention period (in our case, after two days). You can either delete it (will go to the Recycle Bin), trigger a disposition review (will send an email to a designated reviewer to decide on what to do with content) or leave the content as is (will leave the documents in the library and let the user delete it manually). For this demo, I will let it be deleted to show you what happens at the end of the retention period.
- Lastly, you have to specify how retention will be calculated (when the retention clock will start ticking). The choices are: When it was created (date the document uploaded to the library), when it was last modified, when it was labeled, an event. Different uses cases might prompt you to choose one over the other, but again, in our case, let’s keep it simple and choose when it was created. Click Next
- You then get a screen where you can review the settings and adjust as necessary, click Create this label to create a label
- You will now see the label appear in the table/dashboard
STEP 2: Create a label Retention Policy
All we did in the previous steps was to create a label. We now need to tell SharePoint where this label will be applied (which SharePoint sites). To do this, we need to publish a Retention Policy. To do this:
- From the same Information Governance dashboard, click on Label Policies
- Next, click on Publish Labels
- On the next screen, click on Choose labels to publish
- Click Add
- Choose the label(s) you would like to apply to the policy. You can have multiple labels as part of a single policy. For example, a scenario would be, I want to have two labels available on a SharePoint site, one that will classify and keep content for seven years and one that would keep the document forever (so the user can choose which one to apple to a file). In our case, for simplicity purposes, I will select one label (Customer Record), we set up in STEP 1 above. Once you select the label(s), click Add
- Click Done
- Click Next
- On the next screen, we specify the location(s) where we want to publish our label. By default, it will publish it everywhere, but in most cases, you want to specify certain sites, groups, etc. – so make sure to click on Let me choose specific locations radio button
- In my case, I want to apply the label to just one site that is part of an Office 365 Group, so I unchecked all the other radio buttons/locations and chose Choose groups, so I can specify which Office 365 Group the label will be published to
- Click Choose groups
- Select the group and click Choose, then on the next screen click Done
- Click Next
- Provide a name and description (optional) for your policy, click Next
- On the final review screen, it shows everything you have set up. If you are happy with everything, click Publish labels
- You will now see your policy appearing in the policies dashboard
- If you click on the policy name again, you will see its status (Pending) – meaning that policy publishing to the sites is in progress. The retention labels will not show up in the SharePoint site until the policy is published – On (Success)
- It might take from a few minutes up to 24 hours to fully publish the label (depending on a SharePoint site or group you have chosen). Once that happens, when you go back to the Policy, you will see On (Success). That means that we successfully published the policy and retention labels are now available in the SharePoint Site.
STEP 3: Label Documents with a Retention Label
Well, honey, now it is the most exciting stuff. This is where we now tag the documents against the labels published.
- Tag the document as you would with any other metadata. Since we published the label to the site – you will now see it available in the document information panel. In my case, I also have other labels published, so in my case, you can see additional retention labels appearing in the drop-down below
- It always helps to have an additional column displayed – so you can see the retention label applied
- So now your library will look like this
- By the way, remember that optional description for the users we did in Step 1? When users hover over the label, they will get to see this additional information. So don’t skip it!
Just for the record, there are many ways to apply the retention label to a document. In the example above, I showed you the most basic one, where the retention label is applied at the file level. There are other ways to apply labels too – please check out this wonderful post/presentation from Joanne Klein.
What happens during the retention period?
- Since this is just the retention label and not a label that marks the document as a record, anyone with the Edit permission level (Members) can edit the document, just like they did it before.
- When the users try to delete a document during the retention period (2 days in our case), they will now get to see the following message: “The label that’s applied to this item prevents it from being edited or deleted. Check the item’s label for more details.”
- Any member of the site (those with the Edit privileges) will be able to assign or remove the retention label from the document, just like with any other piece of metadata
What happens after the retention period expires?
Well, you probably expected the files to be automatically deleted after the two days have gone by, did not you? The library looks the same a few days after the expiration of the retention policy. If you look at the screenshot belore, the files should have been deleted automatically two days after they were created, but yet, they are still here four days after being created. Moreover, when trying to delete them manually – you get the same error message as you did during the expiration period.
The reason for this is that Microsoft runs a weekly timer job behind the scenes that checks for all the documents that are affected by the retention policy and takes action at that point in time. Below is a screenshot from their article, proving what I just said. Moreover, the timing of this job cannot be changed.
Finally, six days after the expiration date of the label, the documents have disappeared from the library (got deleted and moved to the Recycle Bin).
At this point, they will follow the regular cycle of the Recycle Bin (will stay there for 93 days, then purged forever). This is it, my friend. Hopefully, you learned how to properly set up document retention via retention labels in SharePoint. Enjoy! As for me, it is time to head over to the kitchen for a shot of Hennessy!