Forum Discussion
Tenant.GetSiteProperties doesn't return storage used anymore
We've been using a scheduled job to get some statistics out of our SPO sites for over a year and one thing we've been using is the Tenant.GetSiteProperties(https://msdn.microsoft.com/en-us/library/microsoft.online.sharepoint.tenantadministration.tenant.getsiteproperties.aspx) to return data about the sites. From this method we've saved data from the property StorageUsage on SiteProperties class (https://msdn.microsoft.com/en-us/library/microsoft.online.sharepoint.tenantadministration.siteproperties.storageusage.aspx). But starting in December it seems like this property is returning 0 for every object. Anyone else experienced this?
- DeletedJan 04, 2017
I ran into the same problem a few weeks ago, for another properpty - web count. (Here's the post on this site about it)
- Jose Vazquez NietoCopper Contributor
we have the same issue, is there a new way to get this information?
- Erik HjalmarssonCopper Contributor
We've changed to use the Site.Usage property instead(UsageInfo includes a Storage property), but that forces us to do one additional CSOM call for each site.
- Deleted
I ran into the same problem a few weeks ago, for another properpty - web count. (Here's the post on this site about it)
- Udaybhanu KarmakarCopper Contributor
I was having the same problem and just figured out that by using tenant.GetSitePropertiesFromSharePoint, I can get the Storage Usage. However, I don't see the WebCount property being filled up, but I didn't paid much attention to it since I was trying to get the Usage.
- Arin RoyBrass Contributor
It is very strange behavior that StorageUsed is suddenly 0 for Tenant.GetSiteProperties() but it is available for Tenant.GetSitePropertiesFromSharePoint(). On MSDN there is no clear distiction beween the 2 methods. And it is also not very clear based on the naming of the functions. Strange that things change but there is hardly any documentation to be found. It is all trial and error at the moment.
- Arin RoyBrass Contributor
So, now I modified my scripts to use the new GetSitePropertiesFromSharePoint() method. And....it seems like a very poorly implemented method. It times out 9 out of 10 attempts made to fetch site properties. And when it does, the collection is almost 1500 site collections (GetSiteProperties does/did around 300 if I'm not mistaken). Why have an implementation to try and fetch 1500 records and timeout most of the time? Anyone have any better luck with GetSitePropertiesFromSharePoint().
Note: Noticed that PNP libraries have been updated to use GetSitePropertiesFromSharePoint() with pull reuqests stating the GetSitePropertiies() will be deprecated.