Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Without jumping the gun and writing some extravagant Web Services CAML query or PowerShell script (which may be optimal here), I would like to ask if anyone knows how to obtain a list of large files in a given SharePoint 2007 Site Collection.

Our database is huge and we are looking to clean-up the actual site data a bit before shrinking the database. I'm aware of SharePoint having size limitations but I believe we've removed or raised the cap if I'm not mistaken.

share|improve this question
    
A basic approach might be iterate among all the sites and libraries and get all the files with length higher than 100MB for example. Are you searching for something like this? –  empo May 6 '11 at 15:21
add comment

5 Answers

up vote 4 down vote accepted

Anyway, it shouldn't be so hard:). This powershell works fine (SP2010). It's just a starting point. It iterates on all the lists of the site.

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Sharepoint")

$rootSite = New-Object Microsoft.SharePoint.SPSite("http://goaw059:25000/sites/itbic")

$spWeb = $rootSite.OpenWeb();

foreach($list in $spWeb.lists)
{
    $list.getitems() | % { 
        if (($_.filesystemobjecttype) -eq 'File') {
            write-output "$($_.name) --> $($_.File.length)"
            }
     }
}
$rootSite.Dispose()
share|improve this answer
    
I really like this powershell script. Thanks for sharing this. I'll mark it as the answer. –  pixelbobby May 6 '11 at 16:05
add comment

A quick way of doing this is to use the WebDAV interface from Windows. Open a document library in Windows Explorer (button on the Documents tab in the ribbon on SP2010 - forgotton where it is on SP2007- in the site actions menu I think). Now you can use the Windows Explorer tools to get the size of a folder, sort by size, filter or search by size, etc., as if it was a folder on your local computer.

The other way is to iterate over your document libraries with PowerShell - but that's not going to work so well with SP2007.

share|improve this answer
add comment

Axceler PinPoint can help, it's free and will identify up to 99 items. It's one of those small tools I keep in my toolbox.

share|improve this answer
    
This product is awesome. You are a gentleman and a scholar! –  pixelbobby May 6 '11 at 15:37
add comment

If your files are indexed by SharePoint search, you could run an Enterprise Search SQL query against the search webservice (SPSearch.asmx for WSS or Search.asmx for MOSS):

SELECT filename, size, path FROM SCOPE()
WHERE contentclass='STS_ListItem_DocumentLibrary' AND path LIKE 'http://servername/sites/MySiteCollection/%' ORDER BY size DESC
share|improve this answer
add comment

Open the top level site collection Open up site settings in the far left column "Site Collection Administration" select "Storage Space Allocation"

Default display is document libraries, and you can sort by the size column. You can also switch to documents to display a list of the largest documents in descending size order.

share|improve this answer
add comment

Your Answer

 
discard

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.