We have a console application (C#) that runs nightly to gather stats about our SharePoint Online environment. It has been logging the number of subsites we have using the SiteProperties.WebsCount property since 9/7/2015. Starting on 12/20/2016, that number has come back as zero instead of the actual value (which is 7,400+). We haven't changed this code since late November and all of the other stat values we gather are valid.
The property is documented here: https://msdn.microsoft.com/EN-US/library/microsoft.online.sharepoint.tenantadministration.siteproper...
I found a PowerShell script that uses the same approach as our console application here: https://gallery.technet.microsoft.com/office/How-to-get-all-the-tenant-2999c21b Below is a PowerShell version of this script that pulls the specific property I'm referring to, .WebsCount.
I've tried a couple of versions of CSOM: Microsoft.SharePointOnline.CSOM.16.1.4727.1200 and Microsoft.SharePointOnline.CSOM.16.1.5903.1200 .
#Adding the Client OM Assemblies
Add-Type -Path "<CSOM_Path>\Microsoft.SharePoint.Client.dll"
Add-Type -Path "<CSOM_Path>\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "<CSOM_Path>\Microsoft.Online.SharePoint.Client.Tenant.dll"
#SPO Client Object Model Context
$spoCtx = New-Object Microsoft.SharePoint.Client.ClientContext($sSiteUrl)
$spoCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($sUsername, $sPassword)
$spoCtx.Credentials = $spoCredentials
$spoTenant= New-Object Microsoft.Online.SharePoint.TenantAdministration.Tenant($spoCtx)
$spoTenantSiteCollections=$spoTenant.GetSiteProperties(0,$true)
$spoCtx.Load($spoTenantSiteCollections)
$spoCtx.ExecuteQuery()
#We need to iterate through the $spoTenantSiteCollections object to get the information of each individual Site Collection
foreach($spoSiteCollection in $spoTenantSiteCollections){
Write-Host "Url: " $spoSiteCollection.Url " - WebCount: " $spoSiteCollection.WebsCount
}