Forum Discussion
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 help please?
3 Replies
- An_admin_123Copper Contributor
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-SPOServiceThat gets me "12" which is definitely wrong. It's at least 100. It doesn't seem to be counting the subsites of subsites.
- BobLatencyCopper ContributorYou 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 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-powershell.html
Regards, Dave