SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am doing capacity planning for a new SharePoint 2010 site, and it would be useful to know the average file size on an existing SharePoint 2007 Server we have for comparision.

Does anyone know if there is a way to query this?

Added bonus would be querying the average number of files per user.

share|improve this question
up vote 3 down vote accepted

This could take quite a long time to run, but here's the straight forward method:

$count = 0L
$totalSize = 0L
$WebApplications = Get-SPWebApplication
foreach ($webApp in $WebApplications){
  foreach ($site in $webApp.Sites){
    foreach ($web in $site.AllWebs){
      foreach ($list in $web.Lists){
        if ($list.BaseType -eq "DocumentLibrary"){
          foreach ($item in $list.Items){
            $totalSize += $item.File.Length
Write-Host "Average file size: $($totalSize/$count)"
share|improve this answer
Great, Thanks! It is just a one off sizing exercise, so speed doesn't really matter. – Andrew May 11 '11 at 1:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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