Chapter 10. Discovering your servers with PowerShell and SMO

Joe Webb

You’ve inherited a SQL Server and you need to collect the relevant information about it. How many databases does it have? When were the backup jobs last run, and were they successful? Are triggers being used in any of the databases? There’s a lot to capture and analyze. Fortunately, you don’t have to point and click to gather this information. You can use PowerShell and SQL Server Management Objects (SMO) to automatically collect the data and display it in a Microsoft Excel spreadsheet. You can even compare the values to industry-recognized best practices and highlight any differences that need your immediate attention.

In this chapter we’ll examine how PowerShell and SMO ...

Get SQL Server MVP Deep Dives, Volume 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.