How to get all Site Collections from one Web Application?
So here is the script:
clear
$rSite = Get-SPSite "SOMESITECOLLECTION"
$spWebApp = $rSite.WebApplication
$stream = [System.IO.StreamWriter] "FILELOCATION.csv"
foreach($site in $spWebApp.Sites)
{
$web = $site.RootWeb
$stream.WriteLine($web.Url + "," + $web.Title)
$site.Dispose()
}
$stream.close()
$rootSite.Dispose()