Get Content Databases per Web Application one-liner


Another one in the series of one-liners. This one will show you all Web Applications, and all associated Content Databses 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:

image

You 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}} >> D:\filename.txt
Advertisements

4 thoughts on “Get Content Databases per Web Application one-liner

  1. Pingback: SharePoint 2010 to 2013 upgrade notes … | Nivas07's Blog

  2. Pingback: Content Database FAQ – SharePoint 2010 – .NET

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s