Getting Storage Metrics for a SharePoint site
Gaining an overview of what takes up space in a SharePoint site is crucial for monitoring large files or a significant number of versions.
Unfortunately, the storage metrics link, <siteurl>/_layouts/15/storman.aspx
, won’t work for libraries with more than 5,000 files without nested folders. While this might go against information architecture principles, creating folders is an option to avoid the list view threshold error.
Here’s a PowerShell script to help you get storage metrics for your SharePoint site:
The output of the script
The storage metrics page shows the true storage value being used, as there are several microservices that run after a file is uploaded to create thumbnails, previews, etc., which causes an increase in the storage used.
For example, the file size for AI_Copilot.docx from the UI is 897.5 KB, while the size reported by the report is only 1.7 MB.
Drilling down into the file versions saved in the document reveals that the file size is indeed 1.7 MB.
How storage is actually calculated by microsoft is not fully transparent.
Conclusion
While the provided PowerShell script can give an indication of the storage size used by files in your SharePoint site, it does not report the actual size used by the files. This discrepancy is due to additional storage consumed by microservices that create thumbnails, previews, and other metadata. Unfortunately, there is no specific endpoint available that provides the exact storage metrics for individual files, including these additional factors.