Content Databases per Web Application oneliner

Another one in the series of oneliners. This one will show you all Web Applications, and all associated Content Databases for these Web Applications:

Get-SPWebApplication | %{Write-Output "`n- $($_.url)"; foreach($cd in $_.contentdatabases){Write-Output $cd.name}}

The output will look similar to this:Get Content Databases per Web Application onelinerYou can output this to a text file by running the following:

Get-SPWebApplication | %{Write-Output "`n- $($_.url)"; foreach($cd in $_.contentdatabases){Write-Output $cd.name}} >> <strong>D:filename.txt</strong>

4 thoughts on “Content Databases per Web Application oneliner

Leave a Reply

Your email address will not be published. Required fields are marked *