Company News

How to get all the Site Collections in a Content Database (PowerShell)

March 23, 2012

I found a really simple one liner PowerShell that will tell you which site collections are in which content databases.

Just copy this line (verbatim – no changes necessary) to a SharePoint 2010 Management Shell, and voila!

Get-SPContentDatabase | %{Write-Output "- $($_.Name)”; foreach($site in $_.sites){write-Output $site.url}}

The reference article is below.


Leave a Reply

Colin Phillips

itgroove Alumni

Colin Phillips

Subscribe via Email


Powered by...

itgroove Corporate Profile
Connect With Us