This power shell script will get the count of all site collections in a sharepoint web-application.The same functionality can also be achieved using C#(c sharp) or using the GUI of central administration. But if you need a quick answer power shell is always handy.
param($Site,$FilePath)
Add-PSSnapin microsoft.sharepoint.powershell -ErrorAction SilentlyContinuefunction GenerateAllSitecollectionsCountInWebapplication ($url){write-host "Extracting the count of site collections in web application....." -foregroundcolor black
try
{ $Site=Get-SPSite $url $spWebApp = $Site.WebApplication
write-host Total count in $url is $Site.WebApplication.Sites.Count -foregroundcolor red
}
catch
{write-host "Unable to Extract Sitecollection count .." -foregroundcolor red
break}
}
GenerateAllSitecollectionsCountInWebapplication -Url "www.yoursite.com"
Fuente: http://sharepointhangout.com/powershell-get-count-of-site-collections-in-webapplication/
Comentarios