Forum Discussion
TeeroyLyon
May 15, 2023Copper Contributor
Update Sensitivity labels for documents powershell?
Hi all, We just migrated sites from on prem to SPO. The old sites had a Security Classification column with our classification (for example, Proprietary and Public). We have sensitivity labels ...
Serkar
Oct 09, 2023Copper Contributor
TeeroyLyon Dear Teeroy, yes it is possible. You need to use the API
POST /drives/{drive-id}/items/{item-id}/assignSensitivityLabel
Source: https://learn.microsoft.com/en-us/graph/api/driveitem-assignsensitivitylabel?view=graph-rest-1.0&tabs=http
I spent some time and have documented the whole process how to do it with PowerShell in my blog:
https://sposcripts.com/assign-sensitivity-labels-in-sharepoint/
Let me know if it helped you