Forum Discussion
Gabriel Smoljar
Sep 29, 2017Brass Contributor
How to get available classification labels with CSOM?
I have created a few compliance labels from the Office 365 Security & Compliance portal. These have been successfully published to one of my SharePoint sites and I can apply it to document from the m...
Gabriel Smoljar
Oct 17, 2017Brass Contributor
See the code in my first reply in this thread. That code was working for me. Keep in mind that it can take up to 24 hours for labels to be propagated to a site. Check in library settings before testing your code just to be sure.
Rahul Srivastava
Oct 17, 2017Copper Contributor
Hi Gabriel,
Thanks for your response, my library is showing up the labels. But my requirement is how to get the label value that is applied to my site. For example if my site has been classified as highly confidential, then I need to generate a report which list down all the sites that are highly confidential.
The CSOM release shows a method (public method Microsoft.SharePoint.Client.CompliancePolicy.SPPolicyStoreProxy.GetAvailableTagsForSiteLabel). I tried using this method but getting the count as 0.
- Gabriel SmoljarOct 17, 2017Brass ContributorThen I am afraid I do not know. I was trying to get the classification label from individual documents. I suggest you start a new thread.
- Rahul SrivastavaOct 17, 2017Copper Contributor
Hi Gabriel,
Thanks for your post, I was able to find my answer. A SharePoint site object has a property classification which provided the desired result in my case.
- Ray04Apr 27, 2021Copper ContributorHi Rahul, Can you please tell what setting you did to make it working?