Wednesday, June 29, 2016

Site Collections Size report

Wanted to quick script to get all site collections size along with their last modified dates, visits. PowerShell is cool enough to do that in two lines.

Get-SPSite -limit All | select url, @{label="Size in MB";Expression={"{0:N2}" -f ($_.Usage.Storage/1000000)}},@{label="ContentDB";Expression={$_.ContentDatabase.Name}},@{label="Visits";Expression={$_.usage.Visits}},@{label="lastmodified";Expression={$_.RootWeb.LastItemModifiedDate}}  | epcsv SiteReport.csv -NoTypeInformation

No comments: