Forum Discussion
JSlei
Sep 14, 2021Copper Contributor
Apply sensitivity labels using PowerShell
Is it possible to apply sensitivity labels to documents in SharePoint (not sites or groups) using PowerShell?
- Sep 16, 2021There is no cmdlet to apply labels to individual files, afaik. Set-AIPFileLabel only works on local files. Using the MIP SDK is probably the way to go, at least until Microsoft introduces a cmdlet/Graph API endpoints.
Funnily enough we do have a cmdlet to remove labels: https://office365itpros.com/2021/03/25/decrypt-sharepoint-online-documents-graph/
JSlei
Sep 15, 2021Copper Contributor
still doesn't answer my question. I'm not looking to script the creation and maintenance of the labels, that's already been done. I'm looking to script the application of the labels to documents in SharePoint. Instead of the user having to label thousands of documents manually, is there a way to script it?
Sep 15, 2021
You're not very clear when asking a question...
Try using the New-AutoSensitivityLabelPolicy then.
Try using the New-AutoSensitivityLabelPolicy then.