Forum Discussion
ellan1537
Dec 14, 2023Iron Contributor
Set Sensitivity label for files in SharePoint library programmatically
All files that are stored in a specific SharePoint Online document library (not the site) should be labeled with a sensitivity label (let's say, Public or Confidential).
Can this be achieved using PnP PowerShell or Power Automate flows? Document library has 550,000+ files.
Thanks in advance!
- Unfortunately, didn't find any straight solution for this purpose.
Created a new document library, set the default classification/sensitivity label and then copied over the content to it from the source library (used migration tool). By doing so, it tagged the documents with label.
- Hi,
Thank a look at this thread where you will find some ideas about how to proceed: https://techcommunity.microsoft.com/t5/sharepoint-developer/update-sensitivity-labels-for-documents-powershell/m-p/3821448 - ellan1537Iron ContributorUnfortunately, didn't find any straight solution for this purpose.
Created a new document library, set the default classification/sensitivity label and then copied over the content to it from the source library (used migration tool). By doing so, it tagged the documents with label.