locked
How to find out the size of a web application in Sharepoint RRS feed

  • Question

  • Hello all, apologies if I'm missing something obvious...

    I'm writing a contract for new web providers and wish to find out the size of a Sharepoint website/web application that I have in my sharepoint site collection as I am going to migrate the website between two different contractors - I need to find out the size in gigabytes.

    I've looked everywhere in Sharepoint Central admin/ in the web application lists/ settings of the site itself/ looked in IIS etc but can't seem to find this information?!

    regards


    kegan1
    Friday, November 25, 2011 11:24 AM

Answers

  • Hi,

    I have written a tool that will add the space used by all site collections in that web application and will provide the output. 

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint.Administration;
    using Microsoft.SharePoint;
    using System.Data;
    
    namespace WebApplicationSize
    {
        class Program
        {
            static void Main(string[] args)
            {
                
                 SPFarm farm = SPFarm.Local;
                SPWebService webService = farm.Services.GetValue<SPWebService>("");
                SPWebApplicationCollection webApplications = webService.WebApplications;
                foreach (SPWebApplication webApplication in webApplications)
                {
                    SPSiteCollection sites = webApplication.Sites;
                    long bytes = 0;
                    foreach (SPSite site in sites)
                    {
                       bytes = bytes + site.Usage.Storage;
                        
                                        
                    }
                    Console.WriteLine("The Web Application " + webApplication.Name + " " + "uses " + bytes.ToString());
                    
                }
                Console.ReadLine();
            }
        }
    }
    
    You need to use similar approach and add the data used for recycle bin, versions,audit data
    and usage analytcs data
    I hope this will help you out.

     


    Thanks, Rahul Rashu
    • Edited by Rashu,Rahul Friday, November 25, 2011 6:37 PM more content
    • Marked as answer by Pengyu Zhao Friday, December 2, 2011 2:07 AM
    Friday, November 25, 2011 6:30 PM

All replies

  • Hello,

    For SharePoint 2007

    Central Administration --> Application Management --> Site collection quotas and lock
    Or use this link http://ca:1234/_admin/sitequota.aspx
    There you will find Current storage used

    Or check you're database size in SQL

    Friday, November 25, 2011 4:05 PM
  • Hi,

    I have written a tool that will add the space used by all site collections in that web application and will provide the output. 

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint.Administration;
    using Microsoft.SharePoint;
    using System.Data;
    
    namespace WebApplicationSize
    {
        class Program
        {
            static void Main(string[] args)
            {
                
                 SPFarm farm = SPFarm.Local;
                SPWebService webService = farm.Services.GetValue<SPWebService>("");
                SPWebApplicationCollection webApplications = webService.WebApplications;
                foreach (SPWebApplication webApplication in webApplications)
                {
                    SPSiteCollection sites = webApplication.Sites;
                    long bytes = 0;
                    foreach (SPSite site in sites)
                    {
                       bytes = bytes + site.Usage.Storage;
                        
                                        
                    }
                    Console.WriteLine("The Web Application " + webApplication.Name + " " + "uses " + bytes.ToString());
                    
                }
                Console.ReadLine();
            }
        }
    }
    
    You need to use similar approach and add the data used for recycle bin, versions,audit data
    and usage analytcs data
    I hope this will help you out.

     


    Thanks, Rahul Rashu
    • Edited by Rashu,Rahul Friday, November 25, 2011 6:37 PM more content
    • Marked as answer by Pengyu Zhao Friday, December 2, 2011 2:07 AM
    Friday, November 25, 2011 6:30 PM
  • Great stuff , thanks a lot

     

    regards


    kegan1
    Saturday, November 26, 2011 1:29 PM