Output Site Collection and storage information Output Site Collection and storage information
Jaydeep Patel

Jaydeep Patel

October 16, 2012

All Post
Output-Site-Collection-and-storage-information
Share:

Reporting on Site Collection and storage information

Wouldn’t it be nice to have a single report of Site Collections, the Content Database each is in, and the size in GB? Well, let’s do it!

First let’s grab the Web Application:

   get-spwebapplication http ://SharePoint 
 
Then we grab the Site Collections (all of them):
[sourcecode language="powershell"]
Get-SPSite -Limit all

Now, let’s select the information we want to see in the report:

select url,contentdatabase
 select url,contentdatabase,@{label="Size in GB";Expression={$_.usage.storage/1GB}}

Now, let’s output the report to a CSV file, making it easy to read in Excel:

  convertto-csv | set-content "L:PowerShellDBsize.csv"

Now let’s put it all together in a single command, piping the commands to produce the report:

 get-spwebapplication http ://SharePoint | Get-SPSite -Limit all | select url,contentdatabase,@{label="Size in GB";Expression={$_.usage.storage/1GB}} | convertto-csv | set-content "L:PowerShellDBsize.csv"

Leave a Reply

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

Want to talk?

Drop us a line. We are here to answer your questions 24*7.