Finding the SharePoint URLs for Teams

Every Team has a SharePoint Site (Collection)

As you probably all know, Office 365 provisions every the group created for each team with a SharePoint site collection. Or rather site, because Microsoft seems to be moving away from referring to collections, possibly because the vast majority of collections created today come from Office 365 Groups and Teams and therefore hold just one site.

In any case, a question posed by Syskit asked how to retrieve the associated SharePoint URLs for teams-enabled Office 365 Groups. The article offered the suggestion that you could run the Get-UnifiedGroup cmdlet as follows:

The big downside with this approach is that a) Get-UnifiedGroup is an “expensive” (slow) cmdlet and b) you return all Office 365 Groups and not the ones enabled for Teams.

Using Get-Team to Find Teams

To be fair, the article was written in November 2018 and doesn’t reflect the state of the art since Microsoft delivered Version 0.9.5 of the Teams PowerShell module. This version enabled the Get-Team cmdlet to return the set of known teams in a tenant, which is what we need to do. This code delivers the result:

The code is simple. Create a set of teams and loop through the set to retrieve the SharePointSiteURL for each team. In fact, Get-UnifiedGroup returns three URLs for SharePoint:

  • SharePointSiteURL: The root of the site.
  • SharePointDocumentsURL: The URL for the default document library created in the site. Each channel in the team has a folder in this library, starting with General for the default channel.
  • SharePointNotebookURL: The URL for the shared OneNote notebook belonging to the Office 365 Group/team. Some organizations prefer to replace the Teams Wiki with OneNote.

Why Not Use the New SharePoint Admin Center?

Some have suggested that you can use the new SharePoint Admin Center to find the URLs. Well, the Admin Center certainly displays the URLs, but it doesn’t distinguish between team sites that belong to Microsoft Teams (team-enabled) or those used by an Office 365 Group that isn’t team-enabled (an Outlook or Yammer group). Although you can certainly generate and download a CSV file from the Admin Center containing the site URL (along with other details) for all the active sites in the tenant, you still must isolate which sites belong to Teams and which don’t. Using the technique above starts with a list of Teams and doesn’t go near the non-team enabled sites.


The set of PowerShell modules used with Office 365 change all the time. That’s a good reason to keep up with change by subscribing to the Office 365 for IT Pros eBook. Chapter 14 tells all about how to manage Office 365 Groups and Teams with PowerShell.

Advertisements

2 Replies to “Finding the SharePoint URLs for Teams”

Leave a Reply

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