Find large files across multiple SharePoint content databases


This blog post contains a tool that will query all content databases on a SQL server looking for files of a given extension and size, it will output a report file that can be loaded into Excel for analysis.

PowerPivot can lead to some large workbooks being stored on your SharePoint farms, the tool in this blog post can be used to scan multiple content databases looking for files based on size and file extension.



Use this tool at your own risk, there is no support, guarantees or warranties for this sample program.  This sample program will query all databases on you SQL server looking for content databases and when found doing a read only query against them.


How to use:

Your Windows credentials must have read access to the master database on the SQL server and read access to all content databases on the server.

You must have a c:\Temp directory on the computer (for the output file)

A complied exe can be found in the SPFileSizeQry\SPFileSizeQry\bin\Debug folder

The output text file has these columns [DBName] [DirName] [LeafName] [Size] [TimeLastModified]


SPFileSizeQry.exe <SQLServer> <Extension to query> <min size in bytes to report>
example: SPFileSizeQry MySqlServerAddr xlsx 50000000
output at C:\temp\SPFileSizeReport.txt 

The source and compiled program are in the zip file attached to this blog post.

Comments (0)

Skip to main content