Overview

26 Validating your estate with dbachecks

Data professionals have long relied on bespoke daily, weekly, and monthly checklists—manual or homegrown scripts—to validate SQL Server environments, often duplicating effort and missing a shared standard. The community answered this by creating dbachecks, an open-source, crowdsourced testing framework built by the dbatools team. Powered by dbatools for discovery and Pester for testing, dbachecks provides a common, extensible set of verifications that validate a SQL Server estate against best practices, and it’s easily installed from the PowerShell Gallery alongside its dependencies.

Using dbachecks is straightforward: run checks with Invoke-DbcCheck (for example, LastFullBackup or the broader LastBackup set), and discover the library of 100+ tests with Get-DbcCheck. Results are Pester-style pass/fail with useful context, and you can focus on issues by showing only failures. The framework is highly configurable: default thresholds (like full backups within 1 day) can be adjusted to match organizational policies via Set-DbcConfig (for example, policy.backup.fullmaxdays, policy.backup.diffmaxhours, policy.backup.logmaxminutes), and available options for each check are discoverable through Get-DbcCheck. Settings persist on the machine, enabling repeatable, policy-aligned validation across instances.

Beyond on-demand verification, dbachecks supports operationalizing results over time. You can convert and persist outcomes to a SQL Server database with Convert-DbcResult and Write-DbcTable, optionally labeling runs for easy analysis. With data stored, Start-DbcPowerBi opens a provided Power BI dashboard that reads from your database, enabling trend tracking, estate-wide visibility, and proactive decision-making for capacity, compliance, and reliability. Together, these capabilities turn routine checks into measurable, auditable health signals for the entire SQL Server estate.

Figure 26.1. dbachecks results are stored in our database.
dbachecks data in a table
Figure 26.2. Configure PowerBI to connect to the database where check results are stored.
PowerBI Connection configuration popup
Figure 26.3. PowerBI dbachecks dashboard gives us a good view of our estate.
dbachecks PowerBI dashboard showing results

Hands-on Lab

Try the following tasks

  • Check the documentation. We have lots of blog posts from our contributors and users showing how to use it.
  • Install dbachecks
  • Run a check to validate if your MaxMemory setting is configured correctly
  • Explore all configurations and existing checks

FAQ

What is dbachecks and how does it relate to dbatools?dbachecks is a community-built PowerShell module (created by the dbatools team) that uses dbatools to gather SQL Server information and Pester to validate it against best practices and your policies. It’s effectively an extension of dbatools focused on automated checks.
How do I install dbachecks and its dependencies?Run Install-Module dbachecks -Scope CurrentUser. This installs dbachecks plus its dependencies (dbatools and PSFramework). Windows includes a compatible Pester, but see the next question if you need to install it.
Which Pester version should I use with dbachecks?Use Pester 4.10.1 or below if you install it yourself: Install-Module Pester -RequiredVersion 4.10.1 -Scope CurrentUser.
How do I run my first backup check?Use Invoke-DbcCheck with a target instance and the check tag: Invoke-DbcCheck -SqlInstance <server> -Check LastFullBackup. This verifies each database has had a full backup within the configured threshold (default: 1 day).
How do I run multiple checks or a whole set of related checks?- Multiple specific checks: Invoke-DbcCheck -SqlInstance <server> -Check LastGoodCheckDb, MaxMemory
- Related set by tag: -Check LastBackup runs the full, diff, and log backup checks.
Add -Show Fails to only display failures.
How can I list all available checks and see their metadata?- List checks: Get-DbcCheck | Select Group, UniqueTag, Description
- Metadata for a check: Get-DbcCheck -Tag LastFullBackup | Format-List
The Config property shows tunable settings; split it for readability: (Get-DbcCheck -Tag LastFullBackup).Config.Split(' ').
How do I customize backup thresholds and behavior?Use Set-DbcConfig to change policies, for example:
- Full backups: Set-DbcConfig -Name policy.backup.fullmaxdays -Value 7
- Differential: policy.backup.diffmaxhours
- Log: policy.backup.logmaxminutes
Other useful options include policy.backup.newdbgraceperiod, skip.backup.readonly, and skip.backup.secondaries.
Where are dbachecks configuration values stored and do they persist?They are stored in the Windows registry on the machine where you set them, so you don’t need to reconfigure them each run.
How can I store dbachecks results in a SQL Server database for trending?Pipe results through the converter and writer:
Invoke-DbcCheck -SqlInstance <server> -Check LastBackup -Passthru | Convert-DbcResult -Label MyRun | Write-DbcTable -SqlInstance <server> -Database <db>
-Passthru returns results to the pipeline; -Label helps identify runs.
How do I visualize results with Power BI?Run Start-DbcPowerBi -FromDatabase, then provide your SqlInstance and ChecksResultDBName. You’ll need Microsoft Power BI Desktop installed. Load the data to see dashboards and trends.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Learn dbatools in a Month of Lunches ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Learn dbatools in a Month of Lunches ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Learn dbatools in a Month of Lunches ebook for free