Get Microsoft Teams and Their SharePoint Site URL 

When a new team is created in Microsoft Teams, it creates a SharePoint site to store the shared documents. Whenever you share the files in Teams, it is automatically added to the SharePoint site’s document library.

 

How to Get Microsoft Teams’ SharePoint URL? 

There are few ways to get the Teams’ SharePoint site URL. 

  1. List all Teams and their SharePoint site URL using Get-UnifiedGroup cmdlet (Recommended) 
  2. Get Teams’ site URL using Get-Team cmdlet (Conventional method) 
  3. View SharePoint URL of a Team through Microsoft Teams 
  4. Find SharePoint sites associated with Microsoft Teams using SharePoint admin center 

 

List SharePoint URL for Teams Using PowerShell: 

When a team is created, a Microsoft 365 group is created to manage team membership. So, we can use Get-UnifiedGroup cmdlet with ResourceProvisioningOptions filter to retrieve the SharePoint URLs for Teams-enabled Microsoft 365 groups. 

The below given code exports Teams and their associated SharePoint site URL to TeamsSPOUrl.csv file.

To run the Get-UnifiedGroup cmdlet, you need to connect to Exchange Online PowerShell module. 

You can download the below script to generate a report on Teams and their SharePoint Online site, along with the additional attributes. 

 

Download Script: GetTeamsSiteURL.ps1 

 

Script Highlights: 
  • The script uses modern authentication to connect to Exchange Online.   
  • The script can be executed with MFA enabled account too.   
  • Exports report results to CSV. 
  • The script is scheduler friendly. I.e., You can pass the credential as parameters instead of saving inside the script. 

 

Get Teams’ Site URL Report – Script Execution: 

To run this script, you can choose any one of the below methods.   

Method 1: Execute the script with MFA/non-MFA accounts. 

 

Method 2: Execute the script by explicitly mentioning credentials. 

Also, you can use the above format trun a PowerShell script from Task Scheduler. If the admin account has MFA, then you need to disable MFA based on the Conditional Access policy. 

 

Sample Output: 

The exported report contains following attributes: Team Name, SharePoint Site URL, Primary SMTP Address, Managed By, Access Type, and Creation Time.

Get Teams' site url

 

Get Teams’ Site URL Using Get-Team Cmdlet: 

Instead of using the ‘ResourceProvisioningOptions’ filter in the Get-UnifiedGroup cmdlet, you can use the Get-Team cmdlet to get Teams connected to Office 365 groups. And then, you can pass the GroupID to the Get-UnifiedGroup cmdlet to get the SharePoint site URL. This was the conventional method followed by most admins before the introduction of an in-built filter. 

To run the above code, you need to connect Microsoft Teams PowerShell and Exchange Online PowerShell module. 

 

View/Open Teams SharePoint URL Through Microsoft Teams: 

To view/open the SharePoint site from a Microsoft Teams, you can follow the below steps. 

  1. Open Microsoft Teams. 
  2. Select the Teams/channel. 
  3. Click the Meatballs menu (three-dot) in the top right corner. 
  4. Select ‘Open in SharePoint 

Get Teams SharePoint site URL

You can follow the above steps to view the SharePoint site of the private channels also. 

 

Find SPO Site Associated With Teams Using SPO Admin Center: 

With new SharePoint Online admin center, you can view all the active sites’ URL. By using built-in views, you can filter out ‘Sites connected to Teams’. When I check in my test tenants, few of the ‘Teams connected sites’ are not listed in the view. So, this method is not a reliable one. 

Why ‘Teams connected sites view’ doesn’t show few ‘Teams connected sites?’ 

If you create a Team through PowerShell, it will not show under ‘Teams connected sites’ until you open the SharePoint site from the Microsoft Teams. 

List Teams and their site url

 

I hope this blog will help you to find teams’ SharePoint sites. If you have any queries, you can reach out to us through the comment section.