SOLVED

Tenant.GetSiteProperties doesn't return storage used anymore

%3CLINGO-SUB%20id%3D%22lingo-sub-37440%22%20slang%3D%22en-US%22%3ETenant.GetSiteProperties%20doesn't%20return%20storage%20used%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37440%22%20slang%3D%22en-US%22%3E%3CP%3EWe've%20been%20using%20a%20scheduled%20job%20to%20get%20some%20statistics%20out%20of%20our%20SPO%20sites%20for%20over%20a%20year%20and%20one%20thing%20we've%20been%20using%20is%20the%20Tenant.GetSiteProperties(%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.online.sharepoint.tenantadministration.tenant.getsiteproperties.aspx%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.online.sharepoint.tenantadministration.tenant.getsiteproperties.aspx%3C%2FA%3E)%20to%20return%20data%20about%20the%20sites.%20From%20this%20method%20we've%20saved%20data%20from%20the%20property%26nbsp%3BStorageUsage%20on%20SiteProperties%20class%20(%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.online.sharepoint.tenantadministration.siteproperties.storageusage.aspx%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.online.sharepoint.tenantadministration.siteproperties.storageusage.aspx%3C%2FA%3E).%20But%20starting%20in%20December%20it%20seems%20like%20this%20property%20is%20returning%200%20for%20every%20object.%20Anyone%20else%20experienced%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-160713%22%20slang%3D%22en-US%22%3ERe%3A%20Tenant.GetSiteProperties%20doesn't%20return%20storage%20used%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-160713%22%20slang%3D%22en-US%22%3E%3CP%3ESo%2C%20now%20I%20modified%20my%20scripts%20to%20use%20the%20new%20%3CSPAN%3EGetSitePropertiesFromSharePoint()%20method.%20And....it%20seems%20like%20a%20very%20poorly%20implemented%20method.%20It%20times%20out%209%20out%20of%2010%20attempts%20made%20to%20fetch%20site%20properties.%20And%20when%20it%20does%2C%20the%20collection%20is%20almost%201500%20site%20collections%20(GetSiteProperties%20does%2Fdid%20around%20300%20if%20I'm%20not%20mistaken).%20Why%20have%20an%20implementation%20to%20try%20and%20fetch%201500%20records%20and%20timeout%20most%20of%20the%20time%3F%20Anyone%20have%20any%20better%20luck%20with%26nbsp%3BGetSitePropertiesFromSharePoint().%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENote%3A%20Noticed%20that%20PNP%20libraries%20have%20been%20updated%20to%20use%26nbsp%3BGetSitePropertiesFromSharePoint()%20with%20pull%20reuqests%20stating%20the%26nbsp%3BGetSitePropertiies()%20will%20be%20deprecated.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-155059%22%20slang%3D%22en-US%22%3ERe%3A%20Tenant.GetSiteProperties%20doesn't%20return%20storage%20used%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-155059%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20is%20very%20strange%20behavior%20that%20StorageUsed%20is%20suddenly%200%20for%20Tenant.GetSiteProperties()%20but%20it%20is%20available%20for%20Tenant.GetSitePropertiesFromSharePoint().%20On%26nbsp%3BMSDN%20there%20is%20no%20clear%20distiction%20beween%20the%202%20methods.%20And%20it%20is%20also%20not%20very%20clear%20based%20on%20the%20naming%20of%20the%20functions.%20Strange%20that%20things%20change%20but%20there%20is%20hardly%20any%20documentation%20to%20be%20found.%20It%20is%20all%20trial%20and%20error%20at%20the%20moment.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-38921%22%20slang%3D%22en-US%22%3ERe%3A%20Tenant.GetSiteProperties%20doesn't%20return%20storage%20used%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-38921%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20having%20the%20same%20problem%20and%20just%20figured%20out%20that%20by%20using%20tenant.GetSitePropertiesFromSharePoint%2C%20I%20can%20get%20the%20Storage%20Usage.%20However%2C%20I%20don't%20see%20the%20WebCount%20property%20being%20filled%20up%2C%20but%20I%20didn't%20paid%20much%20attention%20to%20it%20since%20I%20was%20trying%20to%20get%20the%20Usage.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37627%22%20slang%3D%22en-US%22%3ERe%3A%20Tenant.GetSiteProperties%20doesn't%20return%20storage%20used%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37627%22%20slang%3D%22en-US%22%3E%3CP%3EI%20ran%20into%20the%20same%20problem%20a%20few%20weeks%20ago%2C%20for%20another%20properpty%20-%20web%20count.%20(%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FSharePoint-Developer%2FSiteProperties-WebsCount-property-is-returning-zero-CSOM%2Fm-p%2F36771%22%20target%3D%22_self%22%3EHere's%20the%20post%20on%20this%20site%20about%20it%3C%2FA%3E)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37593%22%20slang%3D%22en-US%22%3ERe%3A%20Tenant.GetSiteProperties%20doesn't%20return%20storage%20used%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37593%22%20slang%3D%22en-US%22%3E%3CP%3EWe've%20changed%20to%20use%20the%20%3CA%20href%3D%22https%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fmicrosoft.sharepoint.client.site.usage.aspx%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ESite.Usage%20property%3C%2FA%3Einstead(UsageInfo%20includes%20a%20Storage%20property)%2C%20but%20that%20forces%20us%20to%20do%20one%20additional%20CSOM%20call%20for%20each%20site.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37545%22%20slang%3D%22en-US%22%3ERe%3A%20Tenant.GetSiteProperties%20doesn't%20return%20storage%20used%20anymore%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37545%22%20slang%3D%22en-US%22%3E%3CP%3Ewe%20have%20the%20same%20issue%2C%20is%20there%20a%20new%20way%20to%20get%20this%20information%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

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.get...) 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.siteproper...). But starting in December it seems like this property is returning 0 for every object. Anyone else experienced this?

6 Replies
Highlighted

we have the same issue, is there a new way to get this information?

Highlighted

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.

Highlighted
Solution

I ran into the same problem a few weeks ago, for another properpty - web count. (Here's the post on this site about it)

Highlighted

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.

Highlighted

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.

Highlighted

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.