Site icon Joanne C Klein

Tips for testing an auto-apply Retention Label policy

Reading Time: 9 minutes

A post written in response to questions surrounding the testing of auto-apply label policies for retention labels in Microsoft 365 and some pragmatic advice based on what I do when testing. 

As of May 2022, a retention label applied via an auto-apply policy can take up to 7 days to apply. That 7 days can seem like forever, particularly if you’re not sure you have the condition specified correctly in the auto-apply condition. Although NONE of the tips I’m about to share can expedite the back-end process to be less than 7 days (sorry to disappoint); they may provide some structure and the comfort and confidence you’re seeking when building out your own organization’s label policies and conditions and the testing around them. Pick and choose those that suit.


Tip 1 – Start with a plan!

This is the most important tip and why its #1. With few exceptions, this is where I start. Proof I walk the talk on this tip is my (large) OneNote notebook dedicated exclusively to retention testing all-up. I do this for several reasons:

You’re well-served to have a thoughtful, intentional, and organized test plan before hands touch the keyboard in the Compliance Center. Your future self will thank you!


Tip 2 – Use a non-production tenant

If you have one available to you, the safest place to test out an auto-apply condition is in a non-production tenant. This is where you “go to school” and learn how the tech works for your specific business scenario before doing it “live”.

Many great use-cases exist for a non-production tenant in this context… here are a few:


Tip 3 – Validate conditions ahead of time

You have 3 options to auto-apply a retention label in the Records Management UI:

Before waiting (up to) 7 days to find out if you’re conditions were accurate, try to validate as much as you can in advance. Here are some ways to validate your conditions for each option:

 

Note: It’s important to know there’s no built-in validation against the keyword query language (KQL) query you enter as your condition within the tool which makes it critically important to ensure the query is right!

*General comment about using Content Explorer in Data Classification to validateThe number of items you see is a calculation and may not reflect the exact number as indicated by this warning from Content Explorer:

This is why I suggest alternative methods to validate in some cases.


Tip 4 – Test against a single container location 

Keep things as simple as the test will allow but no simpler. Universal testing approach by the way. 😉

Testing against a single container location, particularly if you’re on a production tenant will just simplify the test. In most cases, it’s simply not necessary to test against all locations of a specific type. Once the test is complete, the job of unwinding the test may be immeasurably simpler as well.

What do I mean by a “single container location”? 1 SharePoint site or 1 OneDrive site or 1 Exchange mailbox or 1 Microsoft 365 Group.

Make sure you seed content in the container location that will both pass and fail your conditions. Don’t be too “happy path” here… it’s just as important to ensure something is NOT labeled as it is to ensure it IS labeled. 🙂


Tip 5 – Consider a ‘Just label the items’ retention label

Note: ‘Just label the items’ retention label formerly known as ‘Don’t retain or delete items’ retention label

I almost removed this tip from my list with the recent announcement from Microsoft where you can now delete a record retention label not in use (formerly not allowed). However… if you only want to see whether the retention label will be correctly auto applied without having any retention/deletion action taken (likely true in most cases), consider using a retention label configured to ‘Just label the items’, the third option below:

Advantage of this approach? Simplicity. You’re isolating the test to confirming where a retention has been auto-applied, nothing more. 

If you’ve never used this type of label before, here’s a few things to know:

Anecdotal story relating to the last bullet point above – I’ve had customers want to repurpose a ‘Just label items’ retention label once the auto-apply policy has been tested, but this isn’t (currently) possible.


Tip 6 – Confirm where the retention label has been applied

At some point, particularly if you’re testing against multiple container locations, you’ll want to see where all content had the retention label applied. A couple of ways of doing this…

Use Content Explorer in the Data Classification feature of the Purview Compliance Center. However, as stated in Tip 3, the number of items you see is a calculation and may not reflect the exact number with that retention label applied. You will see the warning below to indicate this:

There is also a back-end process that runs before items will appear in the Content Explorer that can take up to 2 days so don’t expect to see up-to-the-minute location results to appear.

For these reasons, I recommend using Search if you want to get the exact list of items with a retention label applied across multiple locations. The quickest ways to do this:

Option 1 – Use PowerShell and search (New-ComplianceSearch) with your matching search query to programmatically retrieve all matching items.

Option 2 – Use Content Search from the Purview Compliance Center with your Retention Label condition. You can export the search report to see the list of items with the label applied. (Note: be aware the retention label is not included in the report if you were wanting to combine multiple retention labels in 1 search):

The above search equates to: compliancetag=”Sample Do Nothing Label 2” and will return all items (SharePoint, Exchange) where the label has been applied.

If you want to build an end-user friendly way for test users to identify content with retention label(s) applied, you can also build a custom search page with filters. Refer to a recent post I wrote describing the steps to do this: Searching for Records inside SharePoint Online


Tip 7 – Testing with Short Retention Periods

You may be tempted to put a short retention period on your retention label (i.e., 1 day) if part of your test includes observing what happens to a record when it reaches the end of its retention period including either an automatic deletion or a disposition review.

Important to remember about this is there are several back-end processes that run to control this end-to-end process:

Because of these back-end processes (which you can’t control), don’t expect your 1-day test retention label to appear in the disposition review page on day 2. In my testing, it may take up to 2 weeks for it to appear.

Yet another reason to document your test plan. 


Tip 8 – Clean up after yourself 😉

At some point, particularly if you’re “testing” in a production tenant (don’t judge… it happens a lot), you will/should want to unwind from your testing setup and get back to a pristine state. 🙂 

I haven’t tested every combination of settings you may want to unwind your tenant from. Below are some simple scenarios I’ve tested.

Note: I’ll add the steps required when you’ve configured a disposition review for the label and items are currently sitting in the Pending items tab of the disposition review page.

Microsoft’s guidance on deleting retention labels from Microsoft Purview is here: Deleting retention labels. In summary, it states you cannot delete:

Steps to remove a retention label from the Purview Compliance Center and from the labeled content:

Note: this applies to regular retention labels, record retention labels, and ‘Just label items’ retention labels.

  1. Remove the label from all retention label policy it’s included in
  2. Wait until the policy(s) is in a state of ‘Enabled (Success)’ – this will also automatically put the retention label in an Inactive status
  3. Select the inactive retention label from the File Plan by clicking the Delete (garbage can) icon – this will remove it from any documents/emails where the label was applied. (my testing took ~a day) You DO NOT have to remove the retention labels – the system will do it for you

4. [Optional] Delete the site/team/group you were testing with

 

There you have it… some of my tips! Hopefully, you’ve found some of these helpful; the hard part comes in the test itself and that parts on you! Good luck. 🙂

Thanks for reading.

-JCK

Exit mobile version