Posts

Showing posts from June, 2016

Get SharePoint Document Library Size using PowerShell

There was requirement to get the document library size. Using PowerShell I able to resolve this requirement. This post is about getting actual Document Library size using PowerShell. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Add-PSSnapin Microsoft.SharePoint.PowerShell $siteURL = "YourSitename" $site = new-object Microsoft.SharePoint.SPSite( $siteURL ) foreach ( $web in $site .AllWebs) { foreach ( $list in $web .Lists) { if ( $list .BaseType -eq "DocumentLibrary" ) { $listSize = 0 foreach ( $item in $list .items) { $listSize += ( $item .file).length } "Web Name: " + $web .Title+ ", Library Name: " + $list .Title+ ", Size: " + [Math] :: Round(( $listSize /1KB),2)+ "KB" } } } I hope this small script will save your time.