Forum Discussion
SiteProperties.WebsCount property is returning zero (CSOM)
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.siteproperties.webscount.aspx
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 I've attached 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 .
- Deleted
The Microsoft support team created this blog post to document this issue: https://blogs.technet.microsoft.com/sharepointdevelopersupport/2017/01/18/how-to-get-webscount-and-other-details-from-sharepoint-online-using-tenant-administration-api/
Hi Deleted,
I've tried the same with Microsoft.SharePointOnline.CSOM.16.1.5903.1200 and it seems to be working without any problem so I don't think that this is related to the version of your CSOM version.
Could this be related to permissions? or an account being locked out?
- Deleted
Hi Pieter Veenstra - I'm pretty sure it's not related to CSOM. I'm getting the same results with a few versions of CSOM.
The Microsoft Support Engineer I'm working with has been able to reproduce the issue. He suggested using the "GetSitePropertiesByUrl" method. However, I did some testing and the data returned from the "GetSiteProperties" method does not match the data returned from the "GetSitePropertiesByUrl" method for the same site collection. (TimeZoneID, WebsCount, StorageUsage, LastContentModifiedDate)
He's working to get confirmation from the product group that this is expected behavior or not. I don't see how this can be anything other than a bug.
- Deleted
The Microsoft Support Engineer is trying to confirm with the product group that this was intentional.