0

A. Context of Access

I do not have acces to the central sharepoint admin center but I am the owner of a site collection and I am site collection administrator:

enter image description here

I am able to connect to my site collection using pnp power shell:

Install-Module PnP.PowerShell -Scope CurrentUser
Connect-PnPOnline -url https://{domain}.sharepoint.com/sites/eis/ -Interactive

Furthermore, the command

Get-PnPSiteCollectionAdmin

returns my email address that I used to connect.

I also checked some permission report and could not see something noticeable.

B. Issue

However, when running following command to remove the social bar / like feature:

Set-PnPSite -SocialBarOnSitePagesDisabled $true

I get

Error: Attempted to perform an unauthorized operation.

=> How can I troubleshoot and resolve that issue?

  • Are there some commands that I cannot excute if I do not have global admin rights, even if the command is on site collection level?

  • Is there some setting in the global admin center that could be used to give me the required access rights or install some missing, required dependencies/features?

  • Is there an alternative way to disable the Social media bar without using the pnp shell?

enter image description here

Related:

1 Answer 1

0

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

# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/work)"

# Connect to SharePoint online site
Connect-PnPOnline -Url $siteUrl -Interactive

# Hide the social bar from SharePoint online modern site pages
Set-PnPSite -SocialBarOnSitePagesDisabled $true

# Show the social bar on SharePoint online modern site pages
Set-PnPSite -SocialBarOnSitePagesDisabled $false

# Disconnect SharePoint online connection
Disconnect-PnPOnline

Make sure to use the Site Collection Administrator account of respective SharePoint site (As it might not work with just owner/full control permissions).

You can also achieve it using SharePoint Online PowerShell or CLI for Microsoft 365. Check this article for more details:

Enable or Disable the Social Bar (Like, Views, Save for later) for individual SharePoint sites

3
  • Thank you for the hint to chec k the site collection admin. I am the site colleciton administrator (or at least I think so) and as already said, the command "Set-PnPSite -SocialBarOnSitePagesDisabled $true" does not work.
    – Stefan
    Commented Dec 21, 2023 at 12:27
  • Can you confirm once if you are SCA for this particular site from "Site Permissions > Site Collection Administrators" section? Commented Dec 21, 2023 at 12:30
  • Yes, I updated the question accordingly.
    – Stefan
    Commented Dec 21, 2023 at 12:38

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.