Summary

In this chapter, we saw a number of snippets that allow us to scope out our SQL Server instance. A combination of WMI cmdlets and SMO script come in handy when using PowerShell to profile the instance and its environment. WMI can be quite helpful, especially when looking at system resources (such as CPU, memory, network, and disk space), while SMO is indispensable when programmatically listing or changing SQL Server properties. Using SMO, we saw how to list current instance settings, query SQL Server error logs, change service accounts, change audit-level settings, and adjust an instance's default backup directory property. This is just a glimpse of what you can do with SQL Server using PowerShell.

In the next chapter, we will look at how ...

Get PowerShell for SQL Server Essentials 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.