Get all SharePoint 2010 database names
I’ve recently been doing what I’ve called a “lift and shift”. This is moving all the SharePoint databases from one SQL Server to another. The process is comparatively simple in itself, but the sheer number of databases involved makes it a process where you have to keep an eye on exactly where you are up to.
Anyway, I needed a way to get all the databases I was going to have to move. Thankfully I found this little Powershell line.
Get-SPDatabase | Sort-Object disksizerequired -desc | Format-Table Name
Note that this returns every database, from Content DBs to the databases assigned to Service Applications. The link has more info about the various options as well.