All Content
Timespan
explore our new search
Comprehensive Guide to Managing Purview Retention Labels via Code
Image Source: Shutterstock.com
Microsoft Purview
Sep 27, 2023 12:53 PM

Comprehensive Guide to Managing Purview Retention Labels via Code

by HubSite 365 about Martin Lingstuyl [MVP] (Home on Blimped)

Microsoft MVP | Microsoft 365 Architect @I4-YOU | Co-maintainer at CLI for Microsoft 365 (PnP) | Blogger ✍️ | Family man 👨‍👩‍👧‍👦 | Cyclist 🚴‍♂️

Pro UserMicrosoft EntraMicrosoft PurviewM365 Hot News

Unlock the power of Microsoft 365 Purview with our guide on using code to manage and apply data retention labels.

In Martin Lingstuyl’s blog post published on February 15, 2023, he explores how to use code to effectively manage and apply Purview retention labels in Microsoft 365. He highlights that Microsoft Purview is instrumental in creating and deploying retention labels across various platforms such as SharePoint, OneDrive, Teams and Exchange.

These labels contribute significantly towards retaining data for required periods, defining if data should be locked as a record in the meantime or deleted post the retention period. They are particularly helpful in maintaining data essential for legal and compliance requirements but aren't actively in use.

The blog post is part of a larger series that aims at guiding readers around various aspects of managing Purview retention labels from a coding perspective. This includes using Purview event-based retention, addressing inaccurately applied Purview retention labels, dealing with the implications of applying these labels to folders, and utilizing Azure Functions to automate Purview data retention.

Tools for Working with Retention Labels

Lingstuyl introduces a variety of tools including Security & Compliance PowerShell, Microsoft Graph API, CLI for Microsoft 365, PnP.PowerShell, SharePoint REST API and Client Side Object Model (CSOM), that can be leveraged in conjunction with Purview retention labels.

He then delves into how each of these tools can be used to manage and apply these labels. Insights are shared on how to get a list of retention labels applicable to SharePoint content, correctly map parameters for applying a retention label, clear a retention label, and lock/unlock Record Versioning. Linguyl also talks about how to configure default retention labels for folders, lists/libraries and much more.

He further explains in detail how each of the tools can be utilized with Purview retention labels. For instance, the PowerShell module is largely comprehensive and lets you list, create, update, publish, and delete retention labels. It is also perfect for automation scenarios, due to its potential to connect with both delegated and application permissions.

The Microsoft Purview Guide

Microsoft 365 Purview retention labels serve an indispensable role in creating and publishing retention labels which can be further applied to the data in SharePoint, OneDrive, Teams and Exchange. The labels are especially useful for retaining data that is essential for judicial and compatibility reasons. Lingstuyl's blog post series offers a comprehensive guide on how to manage these retention labels, deciphering the options and the ways to use them, all from the programming end. The tools this guide explores are the Security & Compliance PowerShell, Microsoft Graph API, CLI for Microsoft 365, PnP PowerShell, SharePoint REST API and the Client Side Object Model (CSOM).

Read the full article Guide: Using Code to Apply & Manage Purview Retention Labels

Microsoft Purview - Comprehensive Guide to Managing Purview Retention Labels via Code

Learn about Guide: Using Code to Apply & Manage Purview Retention Labels

The Microsoft 365 Purview tool gives you the capability to create and publish retention labels that you can apply to data in different tools such as SharePoint, OneDrive, Teams and Exchange. In this blog post, we will dive deeper on how you can manage these retention labels and apply them to SharePoint content using code.

The extensive guide provided by Martin Lingstuyl provides multiple options on how you can manage and apply these labels, each with its own advantages and drawbacks. In his blog series, he has thoroughly explored these methods, which includes using Security & Compliance PowerShell, Microsoft Graph API, CLI for Microsoft 365, PnP.PowerShell, SharePoint REST API, and Client Side Object Model (CSOM).

Each tool can be used to manage and apply retention labels in different ways. For managing retention labels, Security & Compliance PowerShell, Microsoft Graph API, and CLI for Microsoft 365 are suggested. All these tools can be used in automation scenario's as well. They have their own strengths and weaknesses, some are complete and can perform all the operations including listing, creating, updating, publishing and deleting retention labels. Some are powerful but still in beta or have limitations.

For applying retention labels to SharePoint content, you can use several tools and approaches. These tools include CSOM, SharePoint REST API, CLI for Microsoft 365, and PnP PowerShell. Be aware that there are also advised routes and those that should be used with caution. This is due to the powerful functionalities each option offers, which need to be used responsibly.

To work with Purview retention labels effectively, you need at least a basic knowledge of several development and automation tools. These may include PowerShell, APIs calls, SharePoint REST API, CSOM and others that are mentioned in the guide. Having this knowledge will greatly improve your ability to manage and apply these labels in multiple scenarios and platforms.

Moreover, the guide also details how to clear a retention label, use Record Versioning, and how to configure default retention labels. You can use several tools for these tasks as well, including CSOM, the SharePoint REST API, the CLI for Microsoft 365, and PnP.PowerShell.

Overall, the guide provided by Martin Lingstuyl is a very extensive and in-depth resource for learning how to manage and apply retention labels in SharePoint using code. It offers lots of examples and options on how to do it, considering all possible scenarios that you might encounter. If you're managing data in SharePoint, this guide is a must read!

More links on about Guide: Using Code to Apply & Manage Purview Retention Labels

Guidelines for writing code examples - MDN Web Docs
Aug 15, 2023 — The guidelines described in this article apply to the styling and formatting of code examples, irrespective of the language.
Getting started with Visual Studio Code
Getting started with Visual Studio Code. In this tutorial, we walk you through setting up Visual Studio Code and give an overview of the basic features.
How to Start Coding: The Ultimate Guide for Beginner ...
Aug 28, 2023 — Want to learn how to code but unsure where to start? Welcome to coding for beginners. This guide includes languages, resources, and valuable ...

Keywords

Code Guide, Apply Retention Labels, Manage Retention Labels, Purview Retention, Code for Retention, Guide for Purview, Label Application Guide, Label Management Code, Retention Labels Tutorial, Purview Application Code