Requirement: Enable external sharing in OneDrive for Business
How to Enable External Sharing for OneDrive for Business Sites?
OneDrive for Business sites are meant for personal storage in Office 365. However, there are times you may want to allow your users to share content from OneDrive sites with external users such as vendors, clients, customers, etc. To enable external sharing in OneDrive for Business, you should turn on external sharing from OneDrive for Business Admin center. Here is how to enable external sharing in OneDrive for Business:
- Login to SharePoint Admin center at https://YourDomain-Admin.SharePoint.com
- Expand “Policies” and then Click on the “Sharing” link in the left navigation
- In the Sharing page, Under the “External sharing”, To enable external sharing, set the configuration for OneDrive to anything other than “Only people in your organization” (meaning disable external sharing!). Please note, Your “OneDrive” sharing settings can’t be more permissive than SharePoint External sharing settings. These are the options available in External sharing settings:
- “Anyone” – sets the user to share with specific people and anonymous links.
- “New and existing external users” – Enables end-users to share with specific people and can invite other users who are not in the Active Directory.
- “Existing external users” – This requires the external user to be in the Active Directory.
- “Only People in your Organization” – Disables external sharing
- Hit “Save” button in the bottom of the page to commit your changes.
PowerShell to Enable External Sharing in OneDrive for Business
To configure external sharing settings for OneDrive sites, use this PowerShell script:
#Parameter $AdminCenterURL = "https://crescent-admin.sharepoint.com" $OneDriveHostURL = "https://crescent-my.sharepoint.com" $SharingSettings = "Disabled" # Disabled, ExistingExternalUserSharingOnly, ExternalUserSharingOnly, ExternalUserAndGuestSharing #Connect to Admin Center Connect-SPOService -Url $AdminCenterURL #Set External Sharing settings for an OneDrive site Set-SPOSite -Identity $OneDriveHostURL -SharingCapability $SharingSettings
Enable External Sharing for an OneDrive for Business Site:
By default, all existing OneDrive sites inherit external sharing settings from the OneDrive admin center. However, there are times you may want to either enable or disable external sharing for a particular user’s OneDrive for Business site. (Provided you have external sharing enabled for OneDrive for Business at tenant level!)
- Login to Microsoft Admin Center at https://admin.microsoft.com
- Expand Users >> Active Users >> Search and find the user you want to enable External Sharing OneDrive for Business
- Click on the User name to open user properties >> Click on the “OneDrive” tab >> Click on the “Manage external sharing” link under “Sharing” (You won’t get this link if external sharing is disabled at OneDrive Admin center!).
- Tick the “Let people outside your organization access your site” checkbox and choose any of the options as per your requirement.
E.g., Suppose your OneDrive for Business Tenant-wide configuration is set to allow only external users by inviting them to Azure AD. In that case, you can go for the last option, “Only allow sharing with existing guest users in the directory.”
Please note, Since SharePoint and OneDrive products are tightly coupled, and OneDrive is on top of SharePoint Online, External sharing at Individual OneDrive sites can’t be more permissive than the OneDrive for Business external sharing settings configured at the tenant level. E.g., If the external sharing settings at your OneDrive for Business Admin site is set to “Existing external users”, then settings at your OneDrive site should be “Only allow sharing with existing guest users in the directory” or lesser (External sharing disabled!). Otherwise, You’ll receive an error message “Update failed for OneDrive external sharing setting. It needs to be more restrictive. Please check the sharing setting under Resources > Sites.”
PowerShell to Enable External Sharing for an OneDrive Site
We can set the external sharing settings at the site level using PowerShell as well:
#Parameter $AdminCenterURL = "https://crescent-admin.sharepoint.com" $OneDriveSiteURL = "https://crescent-my.sharepoint.com/personal/vahab_crescent_com" $SharingSettings = "Disabled" # Disabled, ExistingExternalUserSharingOnly, ExternalUserSharingOnly, ExternalUserAndGuestSharing #Connect to Admin Center Connect-SPOService -Url $AdminCenterURL #Set External Sharing settings for an OneDrive site Set-SPOSite -Identity $OneDriveSiteURL -SharingCapability $SharingSettings
Here is another post on configuring external sharing for SharePoint Online: How to Enable External Sharing in SharePoint Online?