Powershell to get count of your SharePoint sites

Often you may have the need to find the need to take a count of all your sites by site collection in your web application. Here is a small #powershell script which will do the work for you, just change the name of your web application:

Add-PSSnapin “Microsoft.SharePoint.PowerShell”

$webapp=Get-SPWebApplication http://yourwebapplication;
$webapp.Sites | %{Write-Host $_.Url ” -Count: ” $_.AllWebs.Count};

Hit like if this was helpful…