0

Using PnP Provisioning Schema for site structure (lists, CTs, fields, etc).
Want to disable modern comments via schema - referring to property in screenshot below enter image description here

How to achieve that via provisioning schema?
(No, I am not interested in doing it manually or via PowerShell).

7
  • 1
    Try setting DisableCommenting property to true with <pnp:ListInstance>. Let me know if this works. Commented Mar 3, 2023 at 13:12
  • Sorry, nope - schema does not have such property. Commented Mar 3, 2023 at 14:33
  • Did you try adding it or just looking at/comparing with schema from the link you shared? Commented Mar 3, 2023 at 15:03
  • Tried adding - you get error if you add it Template is not valid ---> System.AggregateException: One or more errors occurred. (The 'DisableCommenting' attribute is not declared.) Commented Mar 3, 2023 at 15:14
  • 1
    Submitted: github.com/pnp/PnP-Provisioning-Schema/issues/611 Commented Mar 3, 2023 at 17:46

2 Answers 2

1

As already alluded to in the comments for the question, this is not currently possible via the PnP provisioning engine and is therefore not part of the schema. This is likely because the option to disable comments at list level was a recent addition, after major releases to PnP provisioning.

I would recommend making a suggested enhancement to the PnP Framework GitHub repository, since the provisioning engine is part of that library. The issue you have logged is to the schema, but the schema only represents what the provisioning engine can currently process. The change needs to be made to PnP Framework before the schema can be updated.

1

As per our discussion in comments section above, disabling comments in SharePoint lists is not yet supported by PnP Provisioning Schema.

I have added new feature/idea request to add support for enabling/disabling comments in SharePoint lists using PnP Provisioning Schema at:

[FEATURE/Idea] - Allow enabling/disabling comments on individual SharePoint lists by adding support for DisableCommenting in ListInstance


Additional Read:

As this is not yet supported by using PnP Provisioning Schema, you have to do it either manually or using PnP PowerShell or using SharePoint REST API (I know you are not interested in doing it manually or via PowerShell, but these are the only options available currently).

Check these for detailed steps on same:

  1. Enable/Disable the comments for a SharePoint Online/Microsoft List - manually
  2. Enable/Disable SharePoint Online List Comments using PnP PowerShell
  3. Enable/Disable SharePoint Online List Comments using SharePoint REST API

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.