none
Progmatically removing a Site Policy with PowerShell

    Question

  • Our tenancy has multiple site collections and webs, and all have a Site Policy applied. I've now been asked to remove the policy from all sites. Doing it manually is not an option.

    Is there a CSOM or PnP command or snippet I can execute via PowerShell that will allow me to remove a Site Policy from a site?

    Tuesday, January 24, 2017 5:19 PM

Answers

All replies

  • Hi,

    Per my test, ProjectPolicy object doesn’t provide remove method. Thus it’s not supported to remove site policies programmatically now.

    Information about ProjectPolicy class for your reference:

    https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.informationpolicy.projectpolicy.aspx

    I recommend provide a suggest here. Many new features of SharePoint comes from your suggestions, which make product be better.

    Thanks,

    Dean Wang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by Scarekrow76 Wednesday, January 25, 2017 11:11 AM
    Wednesday, January 25, 2017 10:27 AM
    Moderator
  • Many thanks for confirming. I thought that would be the case, as I couldn't find any methods myself.

    Its seems like madness to provide a command that lets you set a policy on a site, but not a command to let you remove it. That's basic CRUD.

    Wednesday, January 25, 2017 11:11 AM