Wednesday 27 June 2012

How to find Site Collection size in SharePoint 2010

To get the Size (in MB) of all Site collections in your SharePoint 2010 Farm

You can use STSADM commands and Powershel script.

STSADM Cmd:

Please navigate to below path

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
and type as    STSADM.exe -o enumsites -url htt:// SharePoint Site

check for detailed information here


2. By using with PoweShell script
Open SharePoint 2010 Management Shell as administrator

---> $sc = Get-SPSite http://sharepointsite/
---> $sc.usage
this will give you the output like as below


If you want to know about the storage of Site Collection only then use the below script

Get-SPSite | select url, @{label="Size in MB";Expression={$_.usage.storage/1MB}} | Sort-Object -Descending -Property "Size in MB" | Format-Table -AutoSize

the above script will give you the site collection size in megabytes.


If you want a copy of site collections size properties in html file, then please use below script

Get-SPSite | select url, @{label="Size in MB";Expression={$_.usage.storage/1MB}} | Sort-Object -Descending -Property "Size in MB" | ConvertTo-Html -title "Site Collections sort by size" | Set-Content SizeReport.html

to overcome the yellow color warning message please use the parameter as -Limit ALL

Get-SPSite -Limit ALL | select url, @{label="Size in MB";Expression={$_.usage.storage/1MB}} | Sort-Object -Descending -Property "Size in MB" | ConvertTo-Html -title "Site Collections sort by size" | Set-Content SizeReport.html

For find out storage space allocation's and Increase Storage please check with below links FYI.,
http://blogs.msdn.com/b/sowmyancs/archive/2008/11/15/how-to-find-out-the-storage-space-allocation-details-a-site-through-code.aspx
http://social.technet.microsoft.com/forums/en-US/sharepointadmin/thread/d6cb11d9-6ed2-4344-aac9-4ca72d8b2c40
http://blogs.officezealot.com/mauro/archive/2005/03/25/4425.aspx
http://sharepointyankee.com/2011/12/28/how-much-storage-space-is-my-site-collection-using/

No comments:

Post a Comment