Report / Configure

Retrieving SharePoint Site URL for Teams Channels

This script can help to identify the SharePoint Urls associated to private and shared channels. For example, eDiscovery when running against 'Specific Locations' or just for reporting purposes

Summary

You may want to retrieve the SharePoint sites of private and shared channels for different reasons like to add to eDiscovery when running against "Specific Locations" or just for reporting purposes. A teams can have up to 30 Private Channels and unlimited shared channels up to the maximum of 1000 channels. This script can help to identify the SharePoint Urls associated to private and shared channels.

powershell

param (
    [Parameter(Mandatory = $true)]
    [string] $domain ,
    [Parameter(Mandatory = $true)]
    [string] $teamName 
)

$adminSiteURL = "https://$domain-Admin.SharePoint.com"
Connect-PnPOnline -Url $adminSiteURL

$team = Get-PnPTeamsTeam -Identity  $teamName

$m365GroupId = $team.GroupId

Get-PnPTenantSite | Where-Object { $_.Template -eq 'TEAMCHANNEL#1' -and $_.RelatedGroupId -eq $m365GroupId  } | select Url,Template, Title

Source Credit

Sample first appeared on Retrieving SharePoint Site URL for Teams Channels

Contributors

Author(s)
Reshmee Auckloo

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Tool documentation & references

Keep exploring