, , ,

Powershell: Get Sharepoint 2010 Site Collection Storage Usage

If you need to get the Storage Usage from a Sharepoint 2010 Site Collection, you can do this with Powershell.

Current Storage Used

1. Start SharePoint 2010 Management Shell or Powershell with the Sharepoint Snapin by:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

2. Create a new Object for a Site Collection:

$MySite = Get-SPSite http://my.sharepoint.com

3. You can now check the members of the $MySite Object:

$MySite | Get-Member (You could also use: Get-SPSite http://mysite.sharepoint.com | Get-Member)

get-spsite http://mysite.sharepoint.com | get-member

4. Now you get an output with a lot of member properties of this Site Collection Object. And you can see there is a member property called Usage, I think thats the right property. Now lets see what we get here:

$MySite.Usage

retruns:

Storage           : 1775819
Bandwidth         : 0
Visits            : 0
Hits              : 0
DiscussionStorage : 0

Ah there is a Storage property, lets use this to only get the used Storage:

$MySite.Usage.Storage

this returns the Storage Space in Bytes. Not really use full, so we get this in Megabytes:

$MySite.Usage.Storage / 1MB

returns:

1.6935....

4 responses

  1. Dan Avatar

    Any idea why when we run this nothing is returned?

  2. Dan Avatar

    So it looks like I am only missing this data on my host named site collections.

  3. Dan Perry Avatar
    Dan Perry

    I’m not getting any usage data, it seems to be null or blank. Is their some set up that i need to do to populate this data?

  4. Isaac Avatar

    doesn’t work for me either….only blank

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.