Share via


Find the size of each folder in SharePoint site

Question

Thursday, October 24, 2013 11:14 AM

We have a SharePoint site containing several thousand folders and need to determine the number of documents in each folder and size of each folder in GB (i.e. the total szie of all the files in the folder). The folder structure is only ever one folder deep. We could write a utility program to do this using the SPLIST web service, but is there an easier, in-built way of doing this?

Thanks

Nigel

 

Nigel T

All replies (5)

Thursday, October 24, 2013 8:54 PM ✅Answered

I think what duba has suggested will work well , if you see the report across all the sitecollection in Webapplication to calcualate the number of folder and size of the documents stored in that.

 However , if you want to create a report .You can create a console application or Webapplication ,

 Steps to follow.

 1. Get all the stecollection in a Webapplication

 2. Iterate through each sitecollection.

 3. Get all subsite within a site collection

 4. Iterate through each subsites

 5. Gett all document library in a Subsite

 6. Get all folder in a document library

 7.Iterate  through each folder

 8. Get all files in each folder

 9. Iterate throgh each file and file has size property .Calcuate the size for each folder ,document libray ,sub site and sitecollection.As per you requirement and also can calculate count in each folder.

Regards,

Jayant

*Please remember to mark your question as answered & Vote helpful,if this solves/helps your problem.*

 


Friday, October 25, 2013 7:19 AM ✅Answered

There's rounding errors all over the place and the system doesn't always report the true size of the content on disk but it should be broadly correct.


Thursday, October 24, 2013 11:39 AM

You can view this data through the GUI.

Go to the root of your site collection

Site Actions > Site Settings

Under Site Collection Administration click on 'Storage Metrics'

That gives you a reasonable GUI with drill down options to see what's taking up space in your site.


Thursday, October 24, 2013 1:21 PM

Alex

Thanks for the quick reply. I asked our SharePoint Admin to perform this query, but I am a bit wary of the results. The first page reported the top level folder percentage usage of the parent but the total percentage added up to much more than 100% - am I misreading what it is reporting?

Thanks

Nigel

Nigel T


Thursday, October 24, 2013 7:55 PM

Storage metrics are per site collection, so if you have multiple site collections, you will need to perform it on all of them.