The Script will generate the report and show the each document, folder size in all of the SharePoint Document library on SharePoint Site.

The script is really quite straightforward – it simply iterates through all Web Applications, Site Collections, Webs, Document Library, and finally, each Document. I skipped any List that is not a Document Library (as well as the Central Admin site) and then build the report and exported in CSV file that you can open in Excel to use the Excel Pivot table.

The code is also taking care for the list view threshold if you have more items it will bring only 2000 items in one query so performance point of view you no need to worry when you run on production server.

What you have to do

Copy the code and save as .ps1 file with any name

Open the file and change the site collection URL [The site you want to generate the report]

Execute the script, that’s it.

The generated report from Utility excel sheet looks like below.

You can make the Pivot table from the generated output file like below

About Krishana Kumar

Krishana Kumar is SharePoint Architect/Trainer having Architecture experience with high volumes at Enterprise level and global scale - creation of highly scalable solutions with global user base and geographically distributed architectural components. Good knowledge of SharePoint best practices and governance models. I hold Two Master degree in Computer Science with over 11 years of experience working on Microsoft Technologies specially SharePoint, Project, .NET and other Information Worker Technologies. Having good exposer in Client side scripting Angular.js, backbone and Node. I am currently responsible for SharePoint Infrastructure set up and leading teams in various medium and large scale projects, architecting, designing & installing SharePoint farms, developing custom components,, and providing advanced SharePoint administration and development training to teams and customers. I regularly speaks in various SharePoint User Groups and other Events. I have MCSA Windows Azure, MCSA Office 365, MCSE & MCSD SharePoint 2013, Microsoft Certified Developer (MCD) and holds MCPD, MCTIP and MCTS for SharePoint 2010, MCTS MOSS 2007 & WSS 3.0, MCPD, MCITP (EPM 2010 & 2007) and MCSD .NET.