Sometime we need to list all the site collection within the content database.
Below Powershell script explains how to get the list all the site collection within the content database.
- Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site
-
- in $_.sites){write-Output $site.url}}
Output