Changing default link sharing type for Teams channels in Microsoft 365

When you wish to change the default link sharing type for Teams channels in Office/Microsoft 365, the SharePoint admin interface is lacking the options to configure for this. This is now also mentioned in the SharePoint documentation since this GitHub PR, but the updated SP documentation does not go into detail on the exacts steps to take. To bridge the gap, this post will provide a script that you can use.

The following code will solve this problem by looping through all SharePoint sites and setting the default link sharing option to “people with existing access”, which was my use case. You can tweak the script to your requirements.

$admin_site_url = "https://<YOUR_SITE>.sharepoint.com"
 
Connect-SPOService -Url $admin_site_url
$site_collections = Get-SPOSite -Limit All
  
Foreach ($site in $site_collections)
{
    Write-Host $site.Url
    Set-SPOSite -identity $site.Url -DefaultLinkToExistingAccess $true
}

one response for Changing default link sharing type for Teams channels in Microsoft 365

  1. Yaroslav says:

    This post inspired me to buy a used Nutri Feed and install localtuya! )))
    The thing is, I do not se ID3 notr DPS14 in the entities list. I see ID’s: 102, 103, 104, 105 and 110. Did not get what they stand for yet.

  2. Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.