Learn dbatools in a Month of Lunches
Chrissy LeMaire and Rob Sewell
  • MEAP began August 2019
  • Publication in Spring 2021 (estimated)
  • ISBN 9781617296703
  • 400 pages (estimated)
  • printed in black & white

This is an excellent resource to use for advancing your skills with advanced administration for SQL servers, regardless of the number of servers you are administering.

Joseph Houghes
An effective DBA is an efficient DBA. And if you work with SQL Server, dbatools is a lifesaver. With over 500 commands, this free and open source PowerShell module has the horsepower to automate just about every task you can imagine—and then some! Written by dbatools creator Chrissy LeMaire and dbatools advocate Rob Sewell, Learn dbatools in a Month of Lunches teaches you techniques that will make you more effective—and efficient—than you ever thought possible.

About the Technology

Want to automate tasks for thousands of SQL servers at once? Want to migrate an entire SQL server using just the command line? dbatools can do all that—and more. A free and open source PowerShell module, dbatools offers over 500 commands for automating SQL Server from the command line. Boasting advanced options unavailable in official tools, dbatools makes it easy to automate tasks including mass exports for simplified disaster recovery, tempdb configuration, and improving an instance’s security posture.

About the book

Learn dbatools in a Month of Lunches is a practical hands-on guide to automating SQL Server with PowerShell and the awesome dbatools module. You’ll master techniques you can immediately put into practice, from daily duties like backups and restores right through to performing security audits. Stabilize and standardize your SQL server environment, and simplify your tasks by building automation, alerting, and reporting with this powerful tool. Each lesson delivers another skill that you can use to speed through your core tasks as a SQL Server DBA!
Table of Contents detailed table of contents

1 Before you begin

1.1 Why Data Professionals can’t afford to ignore PowerShell

1.1.1 A SQL Server DBA first win with PowerShell

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

2 Installing dbatools

2.1 Minimum Requirements

2.1.1 Server

2.1.2 Workstation

2.1.3 Ports

2.1.4 Execution Policy

2.2 Signed software

2.3 Understanding installation paths

2.4 Installation methods

2.5.1 Downloading zipped archive

2.5.2 Additional Methods

2.6 How to find and use commands, use the help system and docs.dbatools.io

2.6.1 Get-Command

2.6.2 Find-DbaCommand

2.6.3 Get-Help

2.6.4 docs.dbatools.io

2.7 Updating

2.7.2 Alternative methods

2.8 Hands-on Lab

3 Setting up your lab environment

4 A Gentle Introduction to dbatools commands

4.1 Getting started

4.2 Checking the SQL connection

4.3 First, getting help

4.4 Now, run your first dbatools command

4.5 The SqlInstance parameter

4.5.1 Single Instances

4.5.2 Multiple instances

4.6 The SqlCredential parameter

4.6.1 Connecting to Instances with SQL Authentication

4.6.2 Saving the credential to use SQL Authentication with multiple commands

4.6.3 Other methods of using credentials for SQL Authentication

4.6.4 Connecting to Instances with a different Windows Account

4.7 The ComputerName parameter

4.7.1 Methods of listing the SQL services on multiple servers

4.8 The Credential parameter

4.8.1 List Services on a server using a different account at the command line

4.8.2 List Services on a server using a different account with a credential variable

4.8.3 Listing SQL Services by type

4.9 Bonus parameter: EnableException

4.10 Hands On Lab

5 Writing to SQL Server

5.1 Piping Commands

5.2 Writing to a database

5.2.1 Importing from a CSV to a database table

5.2.2 Importing to a database table from a dbatools command

5.2.3 Creating the database table first and then importing from CSV

5.2.4 Writing the results of other commands to a table

5.2.5 Writing the results of other commands to an Azure SQL Database

5.3 Copying Tables including their data

5.3.1 PowerShell splatting

5.4 Hands-on Lab

6 Finding SQL Server Instances on your network

6.1 Background

6.1.1 Find an instance

6.1.2 Find instances using a list of targets

6.1.3 Finding SQL Servers in an Active Directory Domain

6.1.4 Finding SQL Servers in your surrounding network

6.2 Working with detailed results

6.3 OS Support

6.4 Hands-on Lab

7 Inventorying your SQL estate

7.1 SQL Features

7.2 Build

7.3 Host info

7.4 Databases

7.4.1 Filtering the databases that are returned from Get-DbaDatabase

7.4.2 Filtering the databases that are returned from Get-DbaDatabase by last backup time

7.5 Putting it all together into a database

7.6 Hands-on Lab

8 Registered Servers

8.1 Local Server Groups

8.1.1 Version-specific RegSrvr.xml files

8.2 Azure Data Studio

8.3 Central Management Server

8.4 Inventory Organization

8.4.1 Importing advanced environment folder structures

8.5 Further Integration

8.5.1 Add New Registered Servers

8.5.2 Copy, Export, Import

8.5.3 Move Registered Servers

8.5.4 Remove Registered Servers

8.6 Registered Server Groups

8.7 Hands On Lab

9 Logins and users

9.1 A failed login

9.2 Lessons Learned meeting

9.3 Logins, Users and permissions source control

9.4 How was access gained?

9.4.1 Finding nested Active Directory Group access

9.5 Hands-on Lab

10 Backup

11 Restore

12 Building a dedicated backup test server

13 Install and update SQL Server

13.1 Install

13.1.1 Benefits of Automated Installs

13.1.2 Local installs

13.1.3 Update

13.2 Hands On Lab

14 Disaster Recovery

14.1 Export-DbaInstance

14.1.1 Directory of instance T-SQL files

14.1.2 Scripting Options

14.1.3 Setting Scripting Options

14.1.4 Excluding objects

14.2 Granular Exports

14.2.1 Using Export-DbaScript

14.3 Special Commands

14.3.1 Exporting server configurations (sp_configure)

14.4 Hands-on Lab

15 Performing your first advanced SQL instance migration

16 High availability

17 PowerShell and SQL Server Agent

18 SQL Server Agent Administration

19 Creating and Working with SQL Agent Objects

20 DevOps

21 Masking / Invoke-DbaDbDataGenerator

22 Tracing the activity on the instance with dbatools

23 Security and Encryption

24 Cloud

25 Using dbatools and Pester to validate your environment

26 Coding Hints with dbatools

27 Addendum: dbatools Configurations and logging and enable exception


Appendix A: Answers

Chapter 2

Chapter 4

Chapter 5

Chapter 6

Chapter 7

What's inside

  • Installing dbatools in secure environments
  • Bulk-import any type of data into SQL Server
  • Instance-to-instance and customized migrations
  • Schedule and monitor PowerShell tasks in SQL Server Agent

About the reader

For database administrators familiar with SQL Server and PowerShell.

About the authors

Chrissy LeMaire is a dual Microsoft MVP, awarded for her work with SQL Server and PowerShell. She is an international speaker, and the creator of dbatools.

Rob Sewell is a passionate automator, also recognized as an MVP by Microsoft. He is a keen community contributor as an event organizer, speaker and open-source contributor.

placing your order...

Don't refresh or navigate away from the page.
Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
print book $24.99 $49.99 pBook + eBook + liveBook
Additional shipping charges may apply
Learn dbatools in a Month of Lunches (print book) added to cart
continue shopping
go to cart

eBook $19.99 $39.99 3 formats + liveBook
Learn dbatools in a Month of Lunches (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.
customers also reading

This book 1-hop 2-hops 3-hops

FREE domestic shipping on three or more pBooks