Showing posts with label Get Site Collection Usage in SharePoint 2010. Show all posts
Showing posts with label Get Site Collection Usage in SharePoint 2010. Show all posts

Tuesday, August 7, 2012

How To Get Site Collection Usage in SharePoint 2010

Here's the code to get Site Collection Usage in SharePoint 2010 Programatically.
using (SPSite site = new SPSite("http://WebAppName/sites/SiteCollectionName"))
{
   Console.Write("Site Collection Usage (in MB’s) is: " + site.Usage.Storage/(1024*1024) + "MB");
}