Hi @Paing Hein Kyaw
To remove sensitivity labels from multiple files in SharePoint and OneDrive before migrating them to another tenant, you need to ensure a few things:
Why you can't open Labeled Files in the target tenant
When files are labeled with Microsoft Purview sensitivity labels, especially those that apply encryption, only users in the source tenant (where the labels were applied) can access or decrypt them. This is why the target tenant users are unable to open the files.
How to Remove Sensitivity Labels in Bulk (Old Tenant)
You have two main options:
Option 1: Use PowerShell (Preferred for Bulk Removal)
- Connect to SharePoint and OneDrive PowerShell Modules:
- Install the required modules:
Install-Module -Name Microsoft.Graph -Scope CurrentUser
- Use PowerShell to Loop Through Files: You can write a script using the Microsoft Graph API or
Get-PnPListItem
to enumerate files and clear the label using Graph or Purview APIs. For example:# Connect to Microsoft Graph with required permissions Connect-MgGraph -Scopes "Sites.ReadWrite.All", "Files.ReadWrite.All", "InformationProtectionPolicy.ReadWrite.All" # Sample logic to remove labels – pseudocode # Loop through each document and remove label using Graph
Option 2: Manual Removal (GUI - Limited Scale)
- Log in to the source tenant with sufficient rights.
- Open each file (from SharePoint or OneDrive) in Word, Excel, PowerPoint, etc.
- Go to Sensitivity > None (in the toolbar) and save the file.
This is only feasible for a small number of files.
Alternative Approach (If you want to keep Labels)
If you want to keep the labels but allow access in the target tenant, you would need to:
- Re-label the files using labels in the new tenant after migration.
- Or co-author and decrypt the files before migration (manually or via automation).
If the label applies encryption (Rights Management), simply removing the label won’t decrypt the file. You must decrypt first using Microsoft Purview or via Azure Information Protection SDK.
For more information Remove sensitivity labels using Microsoft Graph
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.