Comparing # of SPO sites to Teams sites

Brass Contributor

My company is new to O365, and my boss asked me to give him the number of SPO sites we had, vs the number of Teams sites.


So I ran the following two commands:

PS C:\Users\>> $sites = Get-SPOSite -Limit all

PS C:\Users\>> $sites.Count
499

PS C:\Users\>> $allteams=get-team

PS C:\Users\>> $allteams.count
281

 

When I compare the two lists I find that many of the 281 sites show up in the 499 number, but not all.  In fact there are a good chunk of them that do not.  I am trying to figure out how a MS Team does not have a corresponding SPO site.

 

My boss suggested it might have something to do with a Team being private, and whether my PS would find private team's SPO sites.  I am a global admin, and wasn't sure whether that was enough to see every Teams site or not.

 

As an example the head of HR had 4 Teams sites.  "Sue and Joan", "Sue and Mary", "Sue and Mike", and "Sue and Amy".  Sue is the head of HR and those are her direct reports.  She evidently set up a Teams site for each of them.   All show up in the Teams, but only 1 of those sites shows up in the list of SPO sites.  I haven't gone to her yet to ask her how she set these up because I don't need the head of HR wondering if I'm sniffing through her sites.  I'm just going to assume that she did 1 differently than the others somehow.

 

Thanks in advance for the help.

Ted

 

3 Replies

You can just filter the list based on the Template property, it should have value: GROUP#0

 

But for your scenario, as you might not know the team to which a given site corresponds, you're better off looking at the properties of the underlying Office 365 group:

 

Get-UnifiedGroup groupname | Select SharePointSiteUrl

 

The problem then becomes listing all groups that correspond to a Team, and for that you can use the Teams PowerShell module, or some of the workarounds we discussed previously here: https://techcommunity.microsoft.com/t5/Microsoft-Teams/view-a-list-of-all-Teams-that-have-been-creat...

 

 

Hi Ted,

 

All Microsoft Teams will have an SPO site, they don't work without them. (Funny story, had a user create a team, then go delete the SharePoint site "because he wasn't going to use that".  It broke everything.)

 

From what I understand, the "get-team" cmdlet only runs against a particular user to get the list of teams a user is a member of, and unless you specify an account it will just run against yours.  So, your suspicion is mostly correct in that you won't see those teams that your account has no access to.  Even if your account is a Global Admin (or even SharePoint Admin), it won't have permission to access all the SPO sites within your tenant by default.

 

If you haven't checked out the new SharePoint Admin center, you might browse through that to help identify all your sites and whether they are group-connected or not.  The new admin center give you a nice filterable list of everything that you can export if you want.

Latest update to the Teams cmdlet should return all the Teams and not only the ones the user executing them belongs too. You can also use the new SPO Admin Center to get the list of all your classic and modern Team Sites what includes Team Sites linked to a Group