1 Before you begin

 

1.1  Why Data Professionals can’t afford to ignore PowerShell

Data is now one of the most valuable assets in the world and Data Professionals need a broad set of skills and are expected to be able to accomplish a wide number of tasks. We can be required to:

  • Build SQL Server hosts
  • Develop extract, transform and load (ETL) solutions
  • Ensure SQL instances are correctly configured
  • Monitor and respond to alerts
  • Troubleshoot performance and access issues
  • Perform OS and SQL upgrades
  • Deploy changes to schemas
  • Evaluate index usage and settings
  • And many more

In the process of performing our role, we will interact with a ton of technologies: SQL Server, virtualization (Hyper-V or VMware), operating systems (Windows or Linux), containers, clusters (including Kubernetes clusters), networking, storage, Active Directory, certificates and cloud to name a few.

In the majority of cases, we will be working with with more than one SQL instance. Sometimes 2, sometimes 10,000 or more.

While pretty much everything can be achieved via GUI consoles for any of those technologies, two problems come immediately to mind with this approach:

  • The amount of time wasted
  • The inconsistency of humans compared to machines

This is best explained with a story.

1.1.1  A SQL Server DBA first win with PowerShell

When Rob first became a SQL Server DBA, his first responsibility every morning was to check that Agent Jobs had run successfully across the SQL Server estate. This numbered a little over 100 instances.

1.2  Automate it

1.3  What is dbatools?

1.4  Is this book for you?

1.5  How to use this book

1.5.1  The main chapters

1.5.2  Hands-on labs

1.5.3  Supplementary materials

1.5.4  Further Exploration

1.6  Contacting us

1.7  Being immediately effective with dbatools