Quick SharePoint farm overview using PowerShell

Getting a quick overview of where your data is can be handy at times. Even to create reports. Using built-in SharePoint tools you can easily get site collection information from your whole farm, and convert that information to a CSV. Once you got that CSV, you can do anything with it.

The following script will export the selected data to a CSV file, called “Export.csv”. It will do this for all of the site collections, besides the central administration, in your farm.

Get-SPSite -limit all | select Url,Owner,@{label="ContentDatabase";Expression={$_.ContentDatabase.Name}},@{label="Size in MB";Expression={$_.Usage.Storage/1MB}} | Export-CSV -Path Export.csv -NoTypeInformation

When you open the CSV, you’ll get an output like this:

"Url","Owner","ContentDatabase","Size in MB"
"http://sharepoint","fondant\administrator","SHP2013_Content_SharePoint80","1.93870639801025"
"http://sharepoint/sites/apps","fondant\administrator","SHP2013_Content_SharePoint80","1.1555118560791"
"http://sharepoint/sites/team","fondant\administrator","SHP2013_Content_SharePoint80","1.85408592224121"
"http://sharepoint:81","fondant\administrator","SP2013_Content_SharePoint81","0.111626625061035"

Now you can do practically anything with the data. If you want more properties, check out the SPSite object, and add these to the select statement.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s