How to find Site collection information in SharePoint 2010/2013/2016 using PowerShell?

Hello SharePointers,

Here is the powershell script to get site collection information such as storaged used, site collection name in SharePoint 2010/2013/2016.

function GetAllSitecollectionsInfoInWebapp
{
param ($Webapp)
try
{
foreach($Site in $WebApp.Sites)
{
[int]$usage = $Site.usage.storage/1MB

$OutputString = $Site.Url + “, ” + $usage + ” MB, “+ $Site.Owner
$OutputString | Out-File $OutputFilePath -Append
}
}
catch [System.Exception]
{
write-host -f red $_.Exception.ToString()
}
}

Happy SharePointing 🙂

Leave a Reply

Your email address will not be published.