P-39 Airacobra
P-39 Airacobra

Reputation: 229

How to apply a sensitivity label to a document in SharePoint Online programmatically?

The task is to write a code that applies a sensitivity label to a document in a SharePoint Online document library without downloading the file.

I have explored the following APIs so far:

Upvotes: 4

Views: 5099

Answers (1)

lightupdifire
lightupdifire

Reputation: 19

@P-39 Airacobra

Can be done by PowerShell script:

https://learn.microsoft.com/en-us/microsoft-365/compliance/sensitivity-labels-teams-groups-sites?view=o365-worldwide#use-powershell-to-apply-a-sensitivity-label-to-multiple-sites

But I'm looking for the same, like to apply settings using the unattended way, like REST API, saw something in Microsoft Graph API BETA: https://github.com/microsoftgraph/powershell-aad-samples/blob/master/ReassignSensitivityLabelToO365Groups.ps1 But not tested yet.

Seems found something, will look later: https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/modern-experience-site-classification

Upvotes: 0

Related Questions