fbpx

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.

http://sharepointrelated.com/2012/03/09/get-site-collections-per-content-database-one-liner/

Leave a Reply

Colin Phillips

itgroove Alumni

Colin Phillips

Subscribe via Email

Categories

Powered by...

itgroove Corporate Profile
Connect With Us