Summary

After looking at the basics of PowerShell and exploring a few ways to get some interesting information about servers, this chapter reviewed a script to provide information about each server you manage. Then it examined some of the structures in SQL Server Management Objects (SMO) and some scripts to perform basic administrative tasks. This chapter also looked at a couple scripts to extract data from SQL Server because that's a common request from business people. Finally, this chapter took a quick look at the features in SQL Server 2012 to make PowerShell an integral part of the SQL Server toolset.

Much more can be explored with PowerShell, but this provides a starting point. Automation enables administrators to do more in less time and provide more value to the companies that employ them. PowerShell is a powerful way to automate almost everything an administrator needs to do with SQL Server.

Get Microsoft SQL Server 2012 Bible 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.