Forum Discussion
HeyBeer
Nov 13, 2023Copper Contributor
Auto-Label Sharepoint Folder
Hello, I'm wanting an auto-label policy to apply a sensitivity label to a particular folder within a sharepoint library. I'm lead to believe this is possible using KQL and the 'DocumentLink' doc...
vicwingsing
Nov 20, 2023Iron Contributor
hi HeyBeer,
KQL is not the tool that you would use for this. You can either use the set-label command (https://learn.microsoft.com/en-us/powershell/module/exchange/set-label?view=exchange-ps)
The other option was recommended in this thread: https://techcommunity.microsoft.com/t5/sharepoint-developer/update-sensitivity-labels-for-documents-powershell/m-p/3821448 where Shijuraj recommended using Graph API to assign a label using driveItem: https://learn.microsoft.com/en-us/graph/api/driveitem-assignsensitivitylabel?view=graph-rest-beta&tabs=http
KQL is not the tool that you would use for this. You can either use the set-label command (https://learn.microsoft.com/en-us/powershell/module/exchange/set-label?view=exchange-ps)
The other option was recommended in this thread: https://techcommunity.microsoft.com/t5/sharepoint-developer/update-sensitivity-labels-for-documents-powershell/m-p/3821448 where Shijuraj recommended using Graph API to assign a label using driveItem: https://learn.microsoft.com/en-us/graph/api/driveitem-assignsensitivitylabel?view=graph-rest-beta&tabs=http