Forum Discussion

ellan1537's avatar
ellan1537
Iron Contributor
Dec 14, 2023

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.

Resources