Vue normale

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
À partir d’avant-hierFlux principal

How to Enable/Disable the commenting in SharePoint Online/Microsoft Lists

In my previous blog about Commenting in SharePoint Online and Microsoft lists, I explained where you can find the comments options, what are the permission considerations, working with commenting using SharePoint REST APIs and JSON formatting, etc. In this blog I will explain how you can enable/disable the commenting in SharePoint Online/Microsoft Lists.

Commenting in lists is a great feature which will help many organizations. However, it’s possible that some organizations may want to disable this feature as they already have some mechanism in place for commenting, for example approvals system as mentioned here.

Currently it is not possible to disable commenting at the SharePoint site or list level (possible as of June 2021). Microsoft is working on the new feature which will allow users to enable/disable the comments for individual SharePoint lists.

However, Admins can enable/disable this feature at the organization level by changing the CommentsOnListItemsDisabled parameter in the Set-SPOTenant PowerShell cmdlet:

# To disable comments on list items
Connect-SPOService -Url https://<tenant>-admin.sharepoint.com/ 
Set-SPOTenant -CommentsOnListItemsDisabled $true

# To enable comments on list items
Connect-SPOService -Url https://<tenant>-admin.sharepoint.com/ 
Set-SPOTenant -CommentsOnListItemsDisabled $false

Replace <tenant> with the name of your Microsoft 365 tenant.

Using PnP PowerShell

You can also use PnP PowerShell to enable or disable commenting in SharePoint Online/Microsoft Lists at tenant level:

# Connect to SharePoint online admin center
Connect-PnPOnline -Url https://<tenant>-admin.sharepoint.com/ -Interactive

# To disable comments on list items
Set-PnPTenant -CommentsOnListItemsDisabled $true

# To enable comments on list items
Set-PnPTenant -CommentsOnListItemsDisabled $false

Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to enable or disable commenting in SharePoint Online/Microsoft Lists at tenant level:

# Get Credentials to connect
$m365Status = m365 status
if ($m365Status -match "Logged Out") {
    m365 login
}

# To disable comments on list items
m365 spo tenant settings set --CommentsOnListItemsDisabled true

# To enable comments on list items
m365 spo tenant settings set --CommentsOnListItemsDisabled false

Note: You must be a SharePoint Administrator or Global Administrator in your tenant to enable/disable this feature using PowerShell.

I hope you liked this blog. Give your valuable feedback & suggestions in the comments section below and share this blog with others.

See also

❌
❌