Showing posts with label storage. Show all posts
Showing posts with label storage. Show all posts

December 13, 2008

SharePoint Used Space Information

SharePoint Used Space Information is a console application which allows to retrieve information about space used (bytes) by all sites and sub-sites for a specific site collection into .csv files.

This tool uses the StorageManagementInformation method of the SPSite class to retrieve the usage information.

You can find the solution on CodePlex: http://www.codeplex.com/SPUsedSpaceInfo

September 11, 2008

How to get usage information for a specific site collection by code

To get usage information for a site collection, have a look at the Usage property of the SPSite class.

This property is a structure which contains 5 fields:
- Storage: total amount of storage (bytes) consumed
- DiscussionStorage: amount of storage (bytes) used by the web discussion data
- Hits: cumalative number of visits
- Bandwidth: cumulative bandwith used
- Visits: cumulative number of visits

Note that 2 (Storage and DiscussionStorage) are updated in real time and 3 (Bandwidth, Hits and Visits) are updated daily by the usage analysis timer job.

The following console application displays the usage information for a specific site collection:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
 
namespace UsageInformation
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite siteCollection = new SPSite("http://siteCollectionUrl"))
            {
                Console.WriteLine(string.Format("SiteCollection Url: {0}", siteCollection.Url));
                Console.WriteLine(string.Format("Storage: {0}", siteCollection.Usage.Storage));
                Console.WriteLine(string.Format("Discussion Storage: {0}", siteCollection.Usage.DiscussionStorage));
                Console.WriteLine(string.Format("Bandwidth: {0}", siteCollection.Usage.Bandwidth));
                Console.WriteLine(string.Format("Hits: {0}", siteCollection.Usage.Hits));
                Console.WriteLine(string.Format("Visits: {0}", siteCollection.Usage.Visits));
 
                Console.WriteLine(string.Format("Press a touch to exit..."));
                Console.ReadLine();
            }
        }
    }
}

August 19, 2008

SPSite Storage Information

SPSite Storage Information provides storage reports about documents, documents libraries and lists for a specific site collection in SharePoint. The reports can be exported in excel or pdf.

This tool uses the StorageManagementInformation method of the SPSite class to retrieve the storage information.

You can find the solution on CodePlex:
http://www.codeplex.com/SPSiteStorageInfo