Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Allows to set all the modern groups or Team sites sharing capability to ExternalUserAndGuestSharing in an SPO.

Notifications You must be signed in to change notification settings

OneNoteDev/SetupGuestSharingForTeamSites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

Setup Guest Sharing For Team Sites

Created by Microsoft Corporation, 2018. Provided as-is without warranty. Trademarks mentioned here are the property of their owners.

SharePoint Online has both global (tenant-wide) and site collection settings for external sharing. The tenant-level settings override any settings at the site collection level. For setting up Sharing with anonymous users, both global and site collection settings has to be turned on. See Turn external sharing on or off for SharePoint Online.

For O365 group sites (including Microsoft Teams), the sites created do not have sharing with anonymous users turned on by default. Instead of turning it on manually for each site, the uploaded powershell script allows to set all the modern groups or Team sites sharing capability to ExternalUserAndGuestSharing in an SPO tenant. It enables the creation of anonymous or guest links allowing users to view the content without logging in. This is needed for the class notebook parent and guardian links to work.

IMPORTANT:

  • If sharing with anonymous users is enabled globally on the tenant and for group sites, then any member of the group can share anonymous links in the corresponding site.
  • Tenant admin can always disable external sharing by turning it off globally. See Turn external sharing on or off for SharePoint Online

Prerequisites

Before you begin running the Scripts, review the following information about prerequisites:

  • Set up the SharePoint Online Management Shell environment

Also verify the following:

  • The tenant admin is a Global Administrator in Office 365 for enterprises.
  • The tenant admin is a member of the Administrators group on the server on which you are running the Windows PowerShell script.

SetupGuestSharingForTeamSites.ps1

The PowerShell script contains a cmdlet that can be made available by loading the script

. .\SetupGuestSharingForTeamSites.ps1

The cmdlets is as follows:

Set-ExternalUserAndGuestSharingForTeamSites

It can be used to set the team sites to enable external user And guest sharing.

Example

From the SharePoint Online Management Shell, run the following:

C:\powershell\Connect-SPOService -Url https://contoso-admin.sharepoint.com

C:\powershell\ . .\SetupGuestSharingForTeamSites.ps1

C:\powershell\Set-ExternalUserAndGuestSharingForTeamSites

    Fetching all the group sites
    Found [7567] group sites

    Filtering out the sites that have ExternalUserAndGuestSharing enabled
    Found [6621] group sites to be enabled
    Updating the sharing Capability of the following sites to ExternalUserAndGuestSharing

    1- https://contoso.sharepoint.com/sites/Math101
    2- https://contoso.sharepoint.com/sites/English202
    3- https://contoso.sharepoint.com/sites/Math304
    ...

About

Allows to set all the modern groups or Team sites sharing capability to ExternalUserAndGuestSharing in an SPO.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published