Need a best solution to Remove sensitivity label from the 40000 SharePoint documents in bulk

Saladi Subhasri 0 Reputation points
2024-11-13T08:20:51.24+00:00

Hi Team,

We created the auto label policy in our environment and unfortunately it is applied to all SharePoint sites. there are around 40000 files are labeled so we want to remove that label from all those documents.

so could you please assist all the possible ways to remove the labels from those documents in a easiest way and recommend us which way is best to remove it.

if it possible via PowerShell please add all the steps and script or is there another way to do it then also please mention the way and steps.

Please take this as priority and give immediate response to me so that it will very helpful to me.

Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
1,285 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Chandra Boorla 4,845 Reputation points Microsoft Vendor
    2024-11-14T06:07:27.5533333+00:00

    Hi @Saladi Subhasri

    Apologies for the delay in response.

    Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!

    To remove sensitivity labels from the 40,000 SharePoint documents in bulk, there are several methods you can use. PowerShell is one of the most effective and customizable way to remove sensitivity labels from SharePoint documents.

    Specifically, you can utilize the Unlock-SPOSensitivityLabelEncryptedFile cmdlet to remove the sensitivity label and its associated encryption. However, this cmdlet is primarily for removing encryption from labeled documents. If you want to remove the sensitivity label itself, you will typically need to replace it with a label that does not apply encryption.

    For more details please refer: Unlock-SPOSensitivityLabelEncryptedFile

    Pre-requisites:

    • You need to have the SharePoint Online Management Shell installed.
    • You need the Microsoft Information Protection (MIP) SDK or the Security & Compliance PowerShell modules.
    • You should have administrative access to the SharePoint sites and be an appropriate admin for the Microsoft 365 Security & Compliance Center.

    Here are the steps to remove sensitivity labels from your SharePoint documents using PowerShell:

    • Open PowerShell - Run PowerShell as an Administrator.
    • Connect to SharePoint Online - Use the SharePoint Online Management Shell to connect to your SharePoint Online environment.
    Connect-SPOService -Url https://yourtenant-admin.sharepoint.com
    
    • Identify the Label GUID - If you do not know the GUID of the label you want to remove, you can retrieve the list of sensitivity labels and their GUIDs.
    Get-Label | ft Name, Guid
    
    • Create a Variable for the Label GUID - Store the GUID of the label you want to remove in a variable.
    $Id = [GUID]("your-label-guid-here")
    
    • Get All Sites - You can filter the sites that contain the documents from which you want to remove the label.
    $sites = Get-SPOSite -Limit All
    
    • Remove the Sensitivity Label - Loop through the sites and remove the sensitivity label. You can replace it with a new label that does not apply encryption.
    $sites | ForEach-Object { Set-SPOTenant $_.Url -SensitivityLabel $Id }
    

    PowerShell is one of the most effective and recommend proceeding with PowerShell if you're comfortable with scripting and have admin permissions for the environment. It's the most scalable and customizable approach for bulk document management in SharePoint.

    For reference, please refer the below documentation which might help you.

    Enable sensitivity labels for files in SharePoint and OneDrive

    Use sensitivity labels to protect content in Microsoft Teams, Microsoft 365 groups, and SharePoint sites

    I hope this information helps. Please do let us know if you have any further queries.

    Thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.