SharePoint By Yagya Shree

Storage space used in sharepoint 2007 site collection document library

leave a comment »

Please run below script from a Sharepoint WFE server using farm admin account in powershell window.

Powershell Script:
================
[void][reflection.assembly]::Loadwithpartialname(“Microsoft.SharePoint”)
$url = “http://type your site collection here”
$site = New-Object Microsoft.SharePoint.SPSite($url)
$array = @()
$datatable=$site.StorageManagementInformation(“DocumentLibrary”,”Decreasing”,”Size”,100)
$rows = $datatable.Rows
foreach($row in $rows)
{
$obj = New-Object PSObject
$storage = $row.Size/(1024*1024)
$obj | Add-Member -MemberType NoteProperty -Name “Size” -Value $storage
$obj | Add-Member -MemberType NoteProperty -Name “List Guid” -Value $row.ListGuid
$obj | Add-Member -MemberType NoteProperty -Name “Web Guid” -Value $row.WebGuid
$obj | Add-Member -MemberType NoteProperty -Name “Directory” -Value $row.Directory
$obj | Add-Member -MemberType NoteProperty -Name “Leaf Name” -Value $row.LeafName
$obj | Add-Member -MemberType NoteProperty -Name “Title” -Value $row.Title
$obj | Add-Member -MemberType NoteProperty -Name “Item Count” -Value $row.ItemCount
$array += $obj
}
$array | Export-CSV C:\StorageUsageInfo.csv –NoTypeInformation

Advertisements

Written by Yagyashree

July 26, 2013 at 6:07 pm

Posted in sharepoint

Tagged with , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: