viernes, 21 de diciembre de 2012

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.

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)

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

No hay comentarios:

Publicar un comentario