Forum Discussion
Admin_Tommy_Gustafsson
Dec 12, 2022Copper Contributor
Comments on Modern SharePoint sites
hi we have disabled comments for SharePoint sites in Admin Center is there a way to enable it only on a few sites without enable it for all sites ?
Dec 12, 2022
Not sure if he means about comments on modern pages
Dec 12, 2022
Yeah Juan you're probably right! ![]()
If it's site pages, then he needs to enable it in Admin center as if it's disabled in admin-center then changing the properties in SharePoint using Powershell won't work:
After changing the setting in the admin-center he can run this
:
Connect-PnPOnline -url "" -Interactive
#Get all site collections
$allSites = Get-PnPTenantSite
Foreach($site in $AllSites)
{
//this will disable for all sites
Set-PnPSite -Identity $site -CommentsOnSitePagesDisabled $True
}
//this will enable comments for all specific sites:
Set-PnPSite -Identity $site -CommentsOnSitePagesDisabled $False
//for a specific page
Set-PnPClientSidePage -Identity “Home Page” -CommentsEnabled:$false