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
I hope this information helps. Please do let us know if you have any further queries.
Thank you.