Wrap Test-SPContentDatabase with database name

 

While testing an upgrade to SharePoint 2013 I wanted to review missing server dependencies.   Test-SPContentDatabase does a great job.   However, it doesn’t output the SQL content database name.   That makes it hard to read output on a large farm with many content databases.   By leveraging a custom variable for database name we can augment output with an additional column showing the parent database name for each issue.    Hope you find this helpful!    shades_smile

 

Code

Get-SPDatabase |? {$_.Type -like 'Content*'} |% {$n=$_.Name; $_} | Test-SPContentDatabase | Select *,{$n}

 

References

4 Comments

  1. Excellent advice as always, Jeff! Do you have all of your “handy” script samples like this in one place, by any chance?

      1. Nice! So would it be accurate to say SPLaunch is useful to any admin? It looks like it provides a lot of shortcuts that would be handy. I’ve been working a bit with http://sharepointpowershell.codeplex.com/ lately to automate some things in SharePoint Online and I feel like it’s similar to what SPLaunch is, but focused on the cloud. All good stuff to have handy!

        1. Awesome! I didn’t know about that CodePlex and bookmarked it. Yes, this will be really handy as more people move to the Office 365 cloud. I was actually looking for this two weeks ago when trying to activate a Site Feature remotely without the full SP server cmdlets.

Leave a Comment

Return to Top ▲Return to Top ▲