I an provisioning some modern pages from One site to another using SharePoint PnP PowerShell by Generating and Applying Provisioning Template. I am able to Provision the page with web parts but the Page Comments are not being provisioned. How to provision Page Comments along with modern page?

Below is the code I'm using:

To generate PnP Template

Get-PnPProvisioningTemplate -Out ./mp1ppc.pnp -Handlers Pages, PageContents

To apply PnP Template

Apply-PnPProvisioningTemplate -Path .\mp1.pnp

Please let me know if I' missing anything?

  • Check you template for the Pages that is provisioned. Provisioning Schema Mar 6, 2018 at 10:50
  • @brannmar I checked, The schema doesn't include Comments Enabled attribute, but since I am generating pnp file with PowerShell cmdlet it should include necessary attributes. Mar 7, 2018 at 9:29
  • Which version of the schema do you use? Mar 7, 2018 at 10:39
  • Version: 2.22.1801.0 Mar 8, 2018 at 11:53
  • Thats probably the releaseversion of the pnp powershell installation (January 2018 Release). What im asking for is the schema version for the provisioning template. Probably that is the latest which is 201801. It should have the comments enabled attribute. If not included in your template try adding it. Mar 8, 2018 at 12:15

2 Answers 2


In my experience, the PNP provisioning cmdlets are sometimes buggy, and is not yet full featured, although new features are appearing all the time.

For now, you can change the "Comments" on a modern page after the page has been created.

To disable the comments on a modern page called "Test.aspx":

Set-PnPClientSidePage -Identity "Test.aspx" -CommentsEnabled:$false

To enable the comments on a modern page called "Test.aspx":

Set-PnPClientSidePage -Identity "Test.aspx" -CommentsEnabled:$true

Please note that the Powershell output labels the property "CommentsDisabled", but the cmdlet switch is "CommentsEnabled".

For more information, search the documentation for "Get-PnPClientSidePage" and "Set-PnPClientSidePage"

For the record, I am using the March 2018 version of PnP PowerShell.



It seems that the engine did not have support for disabling comments on moderns pages at the time of this question. This is now supported according to the update notes for May 2018 update

Added CommentsOnSitePagesDisabled property on web settings element in the provisioning engine.

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.