Tag Archives: Test-SPContentDatabase

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

Return to Top ▲Return to Top ▲