Written by 4:30 pm Microsoft, Office 365, PowerShell, Windows Server • 4 Comments

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....

Tags: , , , , , , , , , , , , , Last modified: September 2, 2019
Close Search Window
Close