28 dbatools configurations and logging

 

After reading this book, we hope you feel more comfortable using dbatools to manage multiple SQL Server instances, databases, and features. You now know plenty of commands and procedures to make your work life easier.

In this penultimate chapter, we wanted to introduce you to one more feature that can take your dbatools experience to the next level: the ability to change the way the module works so you can adapt it to your needs. Think of it like our version of Tools > Options, or File > Preferences. We offer similar options using the dbatools configuration system, which can change settings like date/time formatting and connection timeouts.

Throughout the chapter, we’ll walk you through the configuration commands that can help manage your dbatools preferences, and we will also cover the logging system to help you troubleshoot any issues you encounter.

28.1 Working with the configuration system

For most people reading this book, the default configuration values work well. Others in specialized environments may need to modify their configuration settings to ensure that PSRemoting uses SSL, for example. They may also need to change the log retention settings to adhere to company policy.

Before we change any configurations, however, we need to know what settings are available. In this section, we will show how to get the current configured values as well as how to interpret them. Then we’ll show you how to change them.

28.1.1 Checking existing configurations

28.1.2 Getting a specific configuration

28.1.3 Getting just the value

28.1.4 Changing a configuration value

28.1.5 Resetting to default configuration values

28.2 Taking the configs with you

28.3 Using the logging system

28.4 Exploring logged activity

28.4.1 Ongoing logging

28.5 Hands-on lab