How to apply site policy using javascript?

I have created a new sitepolicy. I know that I can apply this policy programatically (ProjectPolicy.ApplyProjectPolicy) but is it possible to apply site policies using javascript? I failed to find any examples thought this should be possible since SCOM API exists.

SharePoint 365 does not support server side code and sandboxed solutions are deprecated.

May 24th, 2015 9:08am

Hi,

Per my understanding, you might want to apply site policy using JavaScript.

There seems no such method in JavaScript Client Object Model to apply site policy:

https://msdn.microsoft.com/en-us/library/office/jj193034.aspx

In Microsoft.SharePoint.Client.InformationPolicy namespace of .NET Client API, there is a ProjectPolicy object which can also be used against Office 365 SharePoint Online environment:

https://msdn.microsoft.com/EN-US/library/office/microsoft.sharepoint.client.informationpolicy.projectpolicy_members.aspx

As a workaround, you can write code with this API to apply site policy to a site in your Office 365 tenant.

A code demo about how to work with site policy using .NET Managed Client Object Model with C# for your reference:

http://blogs.technet.com/b/tothesharepoint/archive/2013/03/28/site-policy-in-sharepoint.aspx  

Thanks 

Patrick Liang
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2015 10:06pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics