Last active
May 5, 2020 12:57
-
-
Save mardahl/dc40e37c44cb0217bc25204a19b5a1b0 to your computer and use it in GitHub Desktop.
Enable anyone links on Teams and Office365 groups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As a default, sharing links with anyone is disabled on Office 365 groupSites, which in turn also means Microsoft Teams Sites. | |
# Even if you have Anyone sharing enabled at the tenant level! | |
# This script can help y remove that requirement from a specific site. | |
# MIT licensing, keep author credits if reusing | |
# Author: Michael Mardahl @michael_mardahl on twitter | |
# https://github.com/mardahl | |
Install-Module -Name Microsoft.Online.SharePoint.PowerShell | |
ipmo Microsoft.Online.SharePoint.PowerShell | |
$tenantName="contoso" #should be what comes before .onmicrosoft.com | |
Connect-SPOService -Url https://$tenantName-admin.sharepoint.com | |
Write-Host "Now is time to select the sites you want to enable guest/anyone sharing on (ctrl can be ued to select mutiple)." | |
$sites = Get-SPOSite | Out-GridView -PassThru | |
#now enabling the creation of anyone links | |
foreach ($site in $sites){ | |
$site | Set-SPOSite -SharingCapability ExternalUserAndGuestSharing | |
} | |
Write-Host "Done!" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment