Forum Discussion
sbonn
Jun 04, 2024Copper Contributor
sharepoint online DisableCompanyWideSharingLinks
reposting Igor's question here as per MSFT's suggestion : "How can I disable the 'Share with entire organization' option globally for OneDrive and SharePoint in Microsoft 365? I've examined the d...
Kidd_Ip
Oct 22, 2024MVP
Take this:
-
Install the SharePoint Online Management Shell
-
Connect to SharePoint Online using the following command:
Connect-SPOService -Url https://<your-tenant>-admin.sharepoint.com -
Set the organization-wide sharing settings. To disable sharing with the entire organization, you can use the following command:
Set-SPOTenant -SharingCapability Disabled -
Apply the setting to all existing sites. You can loop through all sites and apply the setting:
$sites = Get-SPOSite -Limit All foreach ($site in $sites) { Set-SPOSite -Identity $site.Url -DisableCompanyWideSharingLinks Disabled }