0

Hi i have some number of files in a document library and i want sum of all file sizes using powershell or any other way i can get the total file size?

i have a site collections and i get total size of documents based on document creation date in between last two months like march to april

  • Not a simple question... Do you want to include size of document versions? Content of lists? Pages? Content in the Recycle Bin? – Mike Smith - MCT - MVP May 20 '18 at 18:07
0

For an approximate total content size for a Site Collection using PowerShell:

Get-SPSite http://yourServer/sites/yourSite | select StorageUsed

The same from REST API:

http://yourServer/sites/yourSite/_api/site/usage

Count and size for a single library (excluding versions):

Get-SPSite http://yourServer/sites/yourSite | 
  select -ExpandProperty lists | 
  where Title -eq "Documents" | 
  select -ExpandProperty Items | 
  select -ExpandProperty File | 
  measure -Property Length -Sum

Count and size of files for an entire Site Collection (excluding versions, list content, and "other"):

Get-SPSite http://yourServer/sites/yourSite | 
  Get-SPWeb -Limit all | 
  select -ExpandProperty lists | 
  select -ExpandProperty Items | 
  select -ExpandProperty File | 
  measure -Property Length -Sum
  • Hi Mike, i want to check size only for documents in doc libraries, and how i use above query ? – adilahmed May 20 '18 at 19:26
  • Are you asking how to use PowerShell? – Mike Smith - MCT - MVP May 20 '18 at 19:56
  • yes how i use above query , and i required total size based on doc creation in between lat two monts – adilahmed May 20 '18 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.