Thursday, August 3, 2023

Enable or Disable the Social Bar (Like, Views, Save for later) in SharePoint at tenant level


SharePoint Online provides various social features in modern experience SharePoint sites. One of the features available for SharePoint site pages is the social bar (Like, No. of Comments, Views, Save for later), which is situated at the bottom of site pages. Social bar allows users to engage with page content by liking and saving pages for later reference. Social bar also shows the number of page views and comments on modern site pages.

However, organizations may have specific requirements that necessitate enabling or disabling the social bar on SharePoint site pages. Unfortunately, there are no settings available for enabling/disabling social bar using SharePoint user interface. In this blog post, we will explore how to achieve this at SharePoint tenant level using SharePoint Online PowerShell, PnP PowerShell and CLI for Microsoft 365 scripts.

Using SharePoint Online PowerShell

Use below SharePoint Online PowerShell script to enable or disable the social bar from site pages for all SharePoint sites in the tenant:

# SharePoint online admin center URL

$adminCenterUrl = "https://contoso-admin.sharepoint.com/"


# Connect to SharePoint online admin center

Connect-SPOService -Url $adminCenterUrl


# Disable the social bar from SharePoint online site pages

Set-SPOTenant -SocialBarOnSitePagesDisabled $true


# Enable the social bar on SharePoint online site pages

Set-SPOTenant -SocialBarOnSitePagesDisabled $false

Using PnP PowerShell

You can use below PnP PowerShell script to show or hide the social bar from SharePoint online modern experience site pages:

# SharePoint online admin center URL

$adminCenterUrl = "https://contoso-admin.sharepoint.com/"


# Connect to SharePoint online admin center

Connect-PnPOnline -Url $adminCenterUrl -Interactive


# Show the social bar on SharePoint online modern site pages

Set-PnPTenant -SocialBarOnSitePagesDisabled $false


# Hide the social bar from SharePoint online modern site pages

Set-PnPTenant -SocialBarOnSitePagesDisabled $true


Using CLI for Microsoft 365

Use below CLI for Microsoft 365 script to enable or disable the Social Bar (like, No. of comments, views, Save for later) in SharePoint online at tenant level:

# Get Credentials to connect

$m365Status = m365 status

if ($m365Status -match "Logged Out") {

    m365 login

}


# Disable the social bar from SharePoint online site pages

m365 spo tenant settings set --SocialBarOnSitePagesDisabled true


# Enable the social bar on SharePoint online site pages

m365 spo tenant settings set --SocialBarOnSitePagesDisabled false


Conclusion

Enabling or disabling the social bar on site pages in SharePoint Online can be achieved using SharePoint Online PowerShell, PnP PowerShell or CLI for Microsoft 365 scripts. By following the steps outlined in this blog post, you can customize the user experience and align it with your organization’s specific requirements. Whether you want to encourage user engagement or disable social features for certain scenarios, these PowerShell scripts provide the flexibility to control the social bar’s presence on SharePoint online modern site pages.