SQL Server MVP Deep Dives, Volume 2
by Brad McGehee, Louis Davidson, Greg Low, Kimberly Tripp, Paul S. Randal, Kalen Delaney, Paul Nielsen
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access