I'd like to find the total number of sites in SharePoint online

Copper Contributor

All my SPO sites start company.sharepoint.com/, I'm trying to find out the total number of sites and subsites below that.  So far I can't find anything which can show me a total number.  Can anyone help please?

3 Replies

Hello @An_admin_123 

 

you see the total number of sites in your SharePoint Admin Center.

 

The total number uf subsites are not available in an Admin Center. You need to use a Third-Party Tool or PowerShell. Here are examples (I have this Scripts NOT tested): https://www.sharepointdiary.com/2017/05/get-all-site-collections-and-subsites-in-sharepoint-online-p...

 

Regards, Dave

You probably found a solution by now, but in case anyone else stumbles on this thread and needs a quick answer this works, just tested live. Assume you have the latest SPO management shell installed.

Connect-SPOService -Url https://yourtenant-admin.sharepoint.com
$sites = Get-SPOSite -Limit All
$totalSites = $sites.Count
Write-Host "Total number of sites in the tenant: $totalSites"
Disconnect-SPOService

@An_admin_123

 

Connect-SPOService -Url https://yourtenant-admin.sharepoint.com
$sites = Get-SPOSite -Limit All
$totalSites = $sites.Count
Write-Host "Total number of sites in the tenant: $totalSites"
Disconnect-SPOService

 

That gets me "12" which is definitely wrong.  It's at least 100.  It doesn't seem to be counting the subsites of subsites.