Recently, I was asked to generate a report which contains the name of content database of all respected web application in a SharePoint Server.
Below Poweshell script helps us to get Content Database attached to WebApplications.
- Get-SPWebApplication | %{Write-Output "`n- $($_.url)"; foreach($cd in $_.contentdatabases){Write-Output $cd.name}}