Sunday, November 6, 2011

Get Site Collection Usage in SharePoint 2010 Programatically.

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");
}

No comments:

Post a Comment