Reporting SharePoint 2010 Site Collections Storage and Quota using Windows PowerShell

Video length: 2:47

Video description: This video walks through the process of reporting SharePoint 2010 site collections storage and quota using Windows PowerShell

To report usage and quota of your site collections:

Copy the following script into SharePoint 2010 Management Shell (make sure you run it as administrator)

 Get-SPSite | Select URL, @{Name=”Storage”; Expression={“{0:N2} MB” -f
($_.Usage.Storage/1000000)}}, @{Name=”Quota”; Expression={“{0:N2} MP” -f
($_.Quota.StorageMaximumLevel/1000000)} }

Notice how the grid generates a list of your site collections, storage used, and quota allocated

To generate the above into a grid, type in the following script

 Get-SPSite | Select URL, @{Name=”Storage”; Expression={“{0:N2} MB” -f
($_.Usage.Storage/1000000)}}, @{Name=”Quota”; Expression={“{0:N2} MP” -f
($_.Quota.StorageMaximumLevel/1000000)} } | Out-GridView -Title “Sites with Usage”

You may get an error stating that you have to install the Windows PowerShell Integrated Scripting environment feature from server manager. If so, execute the following script to install the feature

Import-Module ServerManagerAdd-WindowsFeature PowerShell-ISE

Observe the “success” for “Exit Code” in the table results. Restart the SharePoint 2010 Management Shell and re-execute the script

 Get-SPSite | Select URL, @{Name=”Storage”; Expression={“{0:N2} MB” -f
($_.Usage.Storage/1000000)}}, @{Name=”Quota”; Expression={“{0:N2} MP” -f
($_.Quota.StorageMaximumLevel/1000000)} } | Out-GridView -Title “Sites with Usage”

 

Leave a Comment