Forum Discussion
An_admin_123
May 17, 2023Copper Contributor
I'd like to find the total number of sites in SharePoint online
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 h...
BobLatency
Oct 27, 2023Copper Contributor
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
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