The below article explains how to enable external sharing using SharePoint Admin Center and using PowerShell.
Basically, some project users want to share some of the project documents outside of the organization users like vendors, clients, or partners. So SharePoint provides an extensive solution to share the documents with them.
For your SharePoint Online Tenant and for an individual site collection, you can choose from the following options.
- Don’t allow sharing outside your organization.
- Allow sharing only with the external users that already exist in your organization’s directory.
- Allow external users who accept sharing invitations and sign in as authenticated users.
- Allow sharing with all external users, and by using anonymous access links.
Before that, we should understand what policy the organization has set up, by navigating to SharePoint Online Admin Center >> Sharing option. Here, you can understand your organization's sharing policy. In my scenario, I am using the default setting on my tenant.
Initially, when the end-user is trying to share some document, folder, or site to the external users, where the external access is not enabled, they will get the error message like below.
When the user reports this kind of problem, we directly go to SharePoint Admin Center and select the site collection which the user is trying to share to external users, and click the "Sharing" option on the ribbon, like highlighted below.
Then, you will see some options like in the below image and as per your organization policy, you can select one of them and click "OK".
In my scenario, I am selecting the third option “Allow external users who accept sharing invitations and sign in as authenticated users” and the site owners only can invite the external users for better security purpose.
Then, it will take some time to apply the changes to the selected site collection.
So, once the external sharing is enabled to your site collection, go to the SharePoint page and use the "Share" option. You can see that this time, the external users are recognized by SharePoint.
Once you click the "Share" button, the external user will get an e-mail notification, like” <username> wants to share you <Document Name>”
And, we can do this operation via PowerShell also. Find the PowerShell script below.
- // Connect the SharePoint Admin center
- Connect-SPOService -Url https:
-
- // Get the site collect URL
- $siteCollectionURL = “https:
-
- // Set the Sharing facility disable
- Set-SPOSite -Identity $siteCollectionURL -SharingCapability Disabled
-
- // Set the Sharing facility only authenticated users
- Set-SPOSite -Identity $siteCollectionURL -SharingCapability ExternalUserSharingOnly
-
- // (Optional) – this will set only site owners can invite the external users
- Set-SPOSite -Identity $siteCollectionURL -DisableSharingForNonOwners
-
- // Set sharing facility as anonymous access
- Set-SPOSite -Identity $siteCollectionURL -SharingCapability ExternalUserAndGuestSharing