Question

I am wondering, if a Team has external sharing enabled, and I am site collection admin/owner of the team and the underlying site, can I disable external sharing? In my case external sharing is just adding complexity, all persons that requires the information already has access and the information is confidential so we do not want external sharing.

According to this article external sharing needs to be disabled both for the O365 group and the SharePoint site, but it also seems like tenant admin rights are required: https://laurakokkarinen.com/how-to-completely-disable-external-sharing-for-a-single-office-365-group/

Is tenant admin rights needed for disabling external sharing? Or can I do this as site collection admin, using PnP or CSOM?

Was it helpful?

Solution

You should be the global administrator of SharePoint. Try below PowerShell.

#Set Admin Center URL
$AdminCenterURL = "https://tenant-admin.sharepoint.com/"
$SiteURL="site collection URL"

#Connect to SharePoint Online
Connect-SPOService -url $AdminCenterURL -Credential (Get-Credential)

#Disable external sharing
Set-SPOSite $SiteURL –SharingCapability "Disabled"

Reference:

https://www.sharepointdiary.com/2017/05/how-to-disable-external-sharing-in-sharepoint-online.html

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top