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.
  1. Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site
  2. in $_.sites){write-Output $site.url}}
Output