When working with SQL Server, usually one of the first tasks is to profile the current instance(s) and environment. This chapter will cover how to quickly profile SQL Server and identify services, instances, settings, and current resources and configurations. This chapter will also introduce you to using Windows Management Instrumentation (WMI) and SQL Server SMO classes to profile and configure SQL Server.
The snippets in this chapter will require the full PowerShell console, run with administrative privileges. Some of the topics we'll cover include how to:
Check server resources (such as CPU, memory, disk space, and network)
Check hotfixes and service packs
Check current SQL Server instances
Check services and service accounts
Check SQL Server logs
List current instance configurations
Change configurations
Start or stop services
Change service accounts
Change instance settings