{"id":15064,"date":"2020-12-14T17:12:36","date_gmt":"2020-12-14T16:12:36","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/"},"modified":"2025-10-01T11:49:17","modified_gmt":"2025-10-01T09:49:17","slug":"validate-your-sql-server-infrastructure-with-dbachecks","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/","title":{"rendered":"Validate your SQL Server infrastructure with dbachecks"},"content":{"rendered":"<h3><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/PowerBIdashboard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-46116\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/PowerBIdashboard.png\" alt=\"\" width=\"500\" height=\"242\"><\/a><\/h3>\n<h3>Introduction<\/h3>\n<p>In this blog post, I&#8217;ll do an introduction to the PowerShell module dbachecks.<br \/>\n<a href=\"https:\/\/github.com\/sqlcollaborative\/dbachecks\">dbachecks<\/a> uses <a href=\"https:\/\/pester.dev\/\">Pester<\/a> and <a href=\"https:\/\/dbatools.io\/\">dbatools<\/a> to validate your SQL Server infrastructure.<br \/>\nWith very minimal configuration you can check that your infrastructure is configured following standard best practices or your own policy.<\/p>\n<p>We will see the following topics<\/p>\n<p style=\"padding-left: 40px\"><strong>&#8211; Prerequisites for dbachecks Installation<\/strong><br \/>\n<strong>&#8211; Introduction to Pester<\/strong><br \/>\n<strong>&#8211; Perform a Check<br \/>\n&#8211; Manage the Configuration items &#8211; Import &amp; Export<br \/>\n&#8211; Output<\/strong><br \/>\n<strong>&#8211; Power BI dashboard<\/strong><\/p>\n<h4>Prerequisites for dbachecks Installation<\/h4>\n<p>The dbachecks module depends on the following modules:<\/p>\n<ul>\n<li>dbatools<\/li>\n<li>Pester<\/li>\n<li>PSFramework<\/li>\n<\/ul>\n<p>The easiest way to perform the installation is to do a simple Install-Module. It will get the latest dbachecks version from the PSGallery and install all the requires modules up to date.<\/p>\n<p>I had many issues with this method.<br \/>\nThe latest versions of PSFramework (<strong>1.4.150<\/strong>) did not seem to work with the current dbachecks version.<br \/>\nInstalling the latest version of Pester (<strong>5.0.4<\/strong>) brings issues too.<br \/>\nWhen running a command I would get the following error:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Unable to find type [Pester.OutputTypes].\nAt line:219 char:9\n+         [Pester.OutputTypes]$Show = 'All'\n+         ~~~~~~~~~~~~~~~~~~~~\n    + CategoryInfo          : InvalidOperation: (Pester.OutputTypes:TypeName) [], RuntimeException\n    + FullyQualifiedErrorId : TypeNotFound<\/pre>\n<p>To avoid this, prior to installing dbachecks, you should first install PSFramework with version <strong>1.1.59<\/strong>.<br \/>\nPester is already shipped with the recent versions of Windows with version <strong>3.4<\/strong>.<br \/>\nIf want to get a newer version, install manually version <strong>4<\/strong>. Issues seem to come with version 5.<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Set-PSRepository -Name \"PSGallery\" -InstallationPolicy Trusted\n\nInstall-Module PSFramework -RequiredVersion 1.1.59\nInstall-Module Pester -RequiredVersion 4.10.1 -Force -SkipPublisherCheck\nInstall-Module dbachecks<\/pre>\n<p>Here is what I got working:<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44809\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png\" alt=\"\" width=\"1064\" height=\"176\"><\/a><\/p>\n<h4>Pester<\/h4>\n<p>dbacheks relies heavily on Pester. Pester is a framework that brings functions to build a unit-test for PowerShell code.<br \/>\nIf you have don&#8217;t know what is Pester I&#8217;d recommend you read my introduction to Pester post <a href=\"https:\/\/www.dbi-services.com\/blog\/an-introduction-to-pester-unit-testing-and-infrastructure-checks-in-powershell\/\">here<\/a>.<\/p>\n<h4>dbatools<\/h4>\n<p>The checks performed by dbatools are based on dbatools functions. If you didn&#8217;t tried dbatools yet I&#8217;d recommend you to have a look at <a href=\"https:\/\/github.com\/sqlcollaborative\/dbatools\/blob\/master\/readme.md\">dbatools&#8217; repository<\/a> and try a <a href=\"https:\/\/gist.github.com\/potatoqualitee\/e8932b64aeb6ef404e252d656b6318a2\">few commands<\/a>.<\/p>\n<h3>Perform a Check<\/h3>\n<p>Now let&#8217;s talk about dbachecks. It&#8217;s is basically a set of Pester tests for your SQL Server infrastructure with code relying heavily on dbatools module.<br \/>\nLet&#8217;s look at the list of available &#8220;Checks&#8221; from dbachecks with <a href=\"https:\/\/dbachecks.readthedocs.io\/en\/latest\/functions\/Get-DbcCheck\/\">Get-DbcCheck<\/a>.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DbcCheckOutGridview.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44941\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DbcCheckOutGridview.png\" alt=\"\" width=\"500\" height=\"384\"><\/a><\/p>\n<p>As you can see, they are currently 134 checks available covering a wide range of configurations you might want to check.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DbcCheckMeasureObject.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44940\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/DbcCheckMeasureObject.png\" alt=\"\" width=\"400\" height=\"102\"><\/a><\/p>\n<p>Let&#8217;s run a Check on an SQL Server instance. To do so we use the <a href=\"https:\/\/dbachecks.readthedocs.io\/en\/latest\/functions\/Invoke-DbcCheck\/\">Invoke-DbcCheck<\/a> command with the Check UniqueTag and the target Instance name.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/7_ValidDatabaseOwner_INST2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44811\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/7_ValidDatabaseOwner_INST2.png\" alt=\"\" width=\"995\" height=\"270\"><\/a><\/p>\n<p>This one checks for the database owner for all user databases of the instance. The default value for this check is configured to &#8220;sa&#8221;.<br \/>\nMy check returned everything green. There&#8217;s only one database on this instance and its database owner is &#8220;sa&#8221;.<\/p>\n<h4>Check multiple instances<\/h4>\n<p>They are many ways to run checks against multiple instances.<br \/>\nYou can define a list of instances in the config parameter with the command below. I&#8217;ll come to configuration elements in a minute.<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Set-DbcConfig -Name app.sqlinstance -Value \"server1\\InstA\", \"localhost\", \"server2\\instA\"<\/pre>\n<p>Here I will use a CMS and the dbatools command <a href=\"https:\/\/docs.dbatools.io\/#Get-DbaRegServer\">Get-DbaRegisteredServer<\/a> to get my list of instances.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/8_ValidDatabaseOwner_CMS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44817\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/8_ValidDatabaseOwner_CMS.png\" alt=\"\" width=\"1000\" height=\"553\"><\/a> On the other instance, one of the databases got a non-&#8220;sa&#8221; database owner.<br \/>\nMaybe this owner is a valid one and I want to have this check succeed. We can modify the check configuration.<\/p>\n<h4>Check Configuration elements<\/h4>\n<p>All checks can have configuration elements.<br \/>\nTo search in the configuration elements you can use <a href=\"https:\/\/dbachecks.readthedocs.io\/en\/latest\/functions\/Get-DbcConfig\/\">Get-DbcConfig<\/a>. I want to change the database owner&#8217;s name, I can search for all config items with names like &#8220;owner&#8221;.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/9_DbcConfig_ValidDBOwner.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44812\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/9_DbcConfig_ValidDBOwner.png\" alt=\"\" width=\"1000\" height=\"215\"><\/a><\/p>\n<p>The configuration values are also available with <a href=\"https:\/\/dbachecks.readthedocs.io\/en\/latest\/functions\/Get-DbcConfigValue\/\">Get-DbcConfigValue<\/a>.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/10_GetDbccConfigValue.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44813\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/10_GetDbccConfigValue.png\" alt=\"\" width=\"584\" height=\"63\"><\/a><\/p>\n<p>So now, with <a href=\"https:\/\/dbachecks.readthedocs.io\/en\/latest\/functions\/Set-DbcConfig\/\">Set-DbcConfig<\/a> I can add a valid database owner to the ValidDatabaseOwner check.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/11_SetDbcConfigValueDBOwner.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-44814\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/11_SetDbcConfigValueDBOwner.png\" alt=\"\" width=\"921\" height=\"160\"><\/a><\/p>\n<p>Here is the output of the same check run again:<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/12_DbcConfig_ValidDBOwner_2-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-44818\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/12_DbcConfig_ValidDBOwner_2-1.png\" alt=\"\" width=\"1000\" height=\"435\"><\/a><\/p>\n<p>Of course, multiple tests can be run at the same time, for example:<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/dbc_MultipleChecks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-46078\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/dbc_MultipleChecks.png\" alt=\"\" width=\"1000\" height=\"859\"><\/a><\/p>\n<h3>Manage the Configuration items &#8211; Import &amp; Export<\/h3>\n<p>We have seen how to use Set-DbcConfig to modify your checks configuration. You don&#8217;t need to change those configurations one by one every time you want to check your infrastructure.<br \/>\nAll configuration items can be exported to a JSON file and imported back again.<\/p>\n<p>I can set the configuration items as needed and then do <a href=\"https:\/\/dbachecks.readthedocs.io\/en\/latest\/functions\/Export-DbcConfig\/\">Export-DbcConfig<\/a> specifying the destination file:<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\"># LastFullBackup - Maximum number of days before Full Backups are considered outdated\nSet-DbcConfig -Name policy.backup.fullmaxdays -Value 7\n\n# Percent disk free\nSet-DbcConfig -Name policy.diskspace.percentfree -Value 5\n\n# The maximum percentage variance that the last run of a job is allowed over the average for that job\nSet-DbcConfig -Name agent.lastjobruntime.percentage -Value 20\n# The maximum percentage variance that a currently running job is allowed over the average for that job\nSet-DbcConfig -Name agent.longrunningjob.percentage -Value 20\n\n# Maximum job history log size (in rows). The value -1 means disabled\nSet-DbcConfig -Name agent.history.maximumhistoryrows -Value 10000\n\n# The maximum number of days to check for failed jobs\nSet-DbcConfig -Name agent.failedjob.since -Value 8\n\n# The number of days prior to check for error log issues - default 2\nSet-DbcConfig -Name agent.failedjob.since -Value 3\n\nExport-DbcConfig -Path \"$($HOME)\\Documents\\WindowsPowerShell\\MorningCheck-Qual.json\"<\/pre>\n<p>Here is the output of the Export-DbcConfig:<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/ExportDbcConfig.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-46114\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/ExportDbcConfig.png\" alt=\"\" width=\"1000\" height=\"217\"><\/a><\/p>\n<p>As you can guess imports of Config files are done with Import-DbcConfig.<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Import-DbcConfig -Path \"$($HOME)\\Documents\\WindowsPowerShell\\MorningCheck-Qual.json\"<\/pre>\n<h3>Output<\/h3>\n<h4>The Show parameter<\/h4>\n<p>The dbachecks output in the console gives a great level of details on what is going on. When you have thousands of checks running you might not want to get this wall of green text.<br \/>\nTo show only the Failed checks you can use the -Show parameter of Invoke-DbcCheck with the value &#8220;Fails&#8221;.<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Invoke-DbcCheck -Check ValidDatabaseOwner -Show Fails<\/pre>\n<p><a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/ShowFails.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-46125\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/ShowFails.png\" alt=\"\" width=\"700\" height=\"342\"><\/a><\/p>\n<p>If you want even fewer details, you can use -Show Summary.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/ShowSummary.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-46127\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/ShowSummary.png\" alt=\"\" width=\"500\" height=\"99\"><\/a><\/p>\n<h4>XML files<\/h4>\n<p>Tests results can also be saved to XML files using the OutputFile parameter like this:<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/OutputFileXML.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-46132\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/OutputFileXML.png\" alt=\"\" width=\"1000\" height=\"78\"><\/a><\/p>\n<p>Here is an output example:<\/p>\n<pre class=\"brush: xml; gutter: true; first-line: 1\">&lt;?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?&gt;\n&lt;test-results xmlns_xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi_noNamespaceSchemaLocation=\"nunit_schema_2.5.xsd\" name=\"Pester\" total=\"2\" errors=\"0\" failures=\"1\" not-run=\"0\" inconclusive=\"0\" ignored=\"0\" skipped=\"0\" invalid=\"0\" date=\"2020-12-14\" time=\"15:29:47\"&gt;\n  &lt;environment clr-version=\"4.0.30319.42000\" user-domain=\"win10vm4\" cwd=\"C:\\Users\\win10vm4admin\\Documents\\WindowsPowerShell\\Modules\\dbachecks\\2.0.7\\checks\" platform=\"Microsoft Windows 10 Pro|C:\\WINDOWS|\\Device\\Harddisk0\\Partition4\" machine-name=\"win10vm4\" nunit-version=\"2.5.8.0\" os-version=\"10.0.18363\" user=\"win10vm4admin\" \/&gt;\n  &lt;culture-info current-culture=\"en-US\" current-uiculture=\"en-US\" \/&gt;\n  &lt;test-suite type=\"TestFixture\" name=\"Pester\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.3166\" asserts=\"0\" description=\"Pester\"&gt;\n    &lt;results&gt;\n      &lt;test-suite type=\"TestFixture\" name=\"C:\\Users\\win10vm4admin\\Documents\\WindowsPowerShell\\Modules\\dbachecks\\2.0.7\\checks\\Database.Tests.ps1\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.3166\" asserts=\"0\" description=\"C:\\Users\\win10vm4admin\\Documents\\WindowsPowerShell\\Modules\\dbachecks\\2.0.7\\checks\\Database.Tests.ps1\"&gt;\n        &lt;results&gt;\n          &lt;test-suite type=\"TestFixture\" name=\"Valid Database Owner\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.2048\" asserts=\"0\" description=\"Valid Database Owner\"&gt;\n            &lt;results&gt;\n              &lt;test-suite type=\"TestFixture\" name=\"Testing Database Owners on localhost\" executed=\"True\" result=\"Failure\" success=\"False\" time=\"0.1651\" asserts=\"0\" description=\"Testing Database Owners on localhost\"&gt;\n                &lt;results&gt;\n                  &lt;test-case description=\"Database dbi_tools - owner sa should be in this list ( sa ) on win10vm4\" name=\"Valid Database Owner.Testing Database Owners on localhost.Database dbi_tools - owner sa should be in this list ( sa ) on win10vm4\" time=\"0.0022\" asserts=\"0\" success=\"True\" result=\"Success\" executed=\"True\" \/&gt;\n                  &lt;test-case description=\"Database testDB - owner win10vm4\\win10vm4admin should be in this list ( sa ) on win10vm4\" name=\"Valid Database Owner.Testing Database Owners on localhost.Database testDB - owner win10vm4\\win10vm4admin should be in this list ( sa ) on win10vm4\" time=\"0.0043\" asserts=\"0\" success=\"False\" result=\"Failure\" executed=\"True\"&gt;\n                    &lt;failure&gt;\n                      &lt;message&gt;Expected collection sa to contain 'win10vm4\\win10vm4admin', because The account that is the database owner is not what was expected, but it was not found.&lt;\/message&gt;\n                      &lt;stack-trace&gt;at &amp;lt;ScriptBlock&amp;gt;, C:\\Users\\win10vm4admin\\Documents\\WindowsPowerShell\\Modules\\dbachecks\\2.0.7\\checks\\Database.Tests.ps1: line 172\n172:                         $psitem.Owner | Should -BeIn $TargetOwner -Because \"The account that is the database owner is not what was expected\"&lt;\/stack-trace&gt;\n                    &lt;\/failure&gt;\n                  &lt;\/test-case&gt;\n                &lt;\/results&gt;\n              &lt;\/test-suite&gt;\n            &lt;\/results&gt;\n          &lt;\/test-suite&gt;\n        &lt;\/results&gt;\n      &lt;\/test-suite&gt;\n    &lt;\/results&gt;\n  &lt;\/test-suite&gt;\n&lt;\/test-results&gt;<\/pre>\n<p>These XML files can be used to automate reporting with the tool of your choice.<\/p>\n<h4>Excel export<\/h4>\n<p>There&#8217;s a way to export the results to Excel. If you want to try it I&#8217;d recommend you to read Jess Pomfret&#8217;s blog post <a href=\"https:\/\/jesspomfret.com\/dbachecks-importexcel\/\">dbachecks meets ImportExcel<\/a>.<\/p>\n<h3>Power BI dashboard<\/h3>\n<p>Checks can be displayed in a beautiful PowerBI dashboard.<\/p>\n<p>The <a href=\"https:\/\/dbachecks.readthedocs.io\/en\/latest\/functions\/Update-DbcPowerBiDataSource\/\">Update-DbcPowerBiDataSource<\/a> command converts results and exports files in the required format for launching the Power BI command Start-DbcPowerBI.<\/p>\n<p>The Update-DbcPowerBiDataSource command can take an &#8220;Environnement&#8221; parameter which is useful to compare your environments.<br \/>\nHere is an example of how it can be used.<\/p>\n<pre class=\"brush: powershell; gutter: true; first-line: 1\">Import-DbcConfig -Path \"$($HOME)\\Documents\\WindowsPowerShell\\MorningCheck-Qual.json\"\nInvoke-DbcCheck -Check ValidDatabaseOwner, ErrorLogCount `\n    -Show Summary -Passthru | Update-DbcPowerBiDataSource -Environment 'Qual'\n\nImport-DbcConfig -Path \"$($HOME)\\Documents\\WindowsPowerShell\\MorningCheck-Prod-Listener.json\"\nInvoke-DbcCheck -Check ValidDatabaseOwner, ErrorLogCount `\n    -Show Summary -Passthru | Update-DbcPowerBiDataSource -Environment 'Prod'\n\nStart-DbcPowerBi<\/pre>\n<p>The dashboard.<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/PowerBIdashboard.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-46116\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/PowerBIdashboard.png\" alt=\"\" width=\"1000\" height=\"484\"><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>From my experience, dbatools use amongst DBA has grown a lot recently. Likewise, I think dbacheck will be used more and more by DBAs in the years to come.<br \/>\nIt&#8217;s easy to use and can save you save a lot of time for your Daily\/Weekly SQL Server checks.<\/p>\n<p>This blog post was just to get you started with dbachecks. Do not hesitate to comment if you have any questions.<\/p>\n\n\n<p>Written by <a href=\"https:\/\/www.linkedin.com\/in\/steven-naudet-aa540158\/\">Steven Naudet<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog post, I&#8217;ll do an introduction to the PowerShell module dbachecks. dbachecks uses Pester and dbatools to validate your SQL Server infrastructure. With very minimal configuration you can check that your infrastructure is configured following standard best practices or your own policy. We will see the following topics &#8211; Prerequisites for dbachecks [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":15066,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229,99],"tags":[2169,2170,2550],"type_dbi":[],"class_list":["post-15064","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-administration-monitoring","category-sql-server","tag-dbachecks","tag-infrastructure","tag-sql-server-2"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Validate your SQL Server infrastructure with dbachecks - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Validate your SQL Server infrastructure with dbachecks\" \/>\n<meta property=\"og:description\" content=\"Introduction In this blog post, I&#8217;ll do an introduction to the PowerShell module dbachecks. dbachecks uses Pester and dbatools to validate your SQL Server infrastructure. With very minimal configuration you can check that your infrastructure is configured following standard best practices or your own policy. We will see the following topics &#8211; Prerequisites for dbachecks [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-14T16:12:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-01T09:49:17+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1064\" \/>\n\t<meta property=\"og:image:height\" content=\"176\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"Validate your SQL Server infrastructure with dbachecks\",\"datePublished\":\"2020-12-14T16:12:36+00:00\",\"dateModified\":\"2025-10-01T09:49:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\"},\"wordCount\":963,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png\",\"keywords\":[\"dbachecks\",\"infrastructure\",\"SQL Server\"],\"articleSection\":[\"Database Administration &amp; Monitoring\",\"SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\",\"name\":\"Validate your SQL Server infrastructure with dbachecks - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png\",\"datePublished\":\"2020-12-14T16:12:36+00:00\",\"dateModified\":\"2025-10-01T09:49:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png\",\"width\":1064,\"height\":176},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Validate your SQL Server infrastructure with dbachecks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Validate your SQL Server infrastructure with dbachecks - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/","og_locale":"en_US","og_type":"article","og_title":"Validate your SQL Server infrastructure with dbachecks","og_description":"Introduction In this blog post, I&#8217;ll do an introduction to the PowerShell module dbachecks. dbachecks uses Pester and dbatools to validate your SQL Server infrastructure. With very minimal configuration you can check that your infrastructure is configured following standard best practices or your own policy. We will see the following topics &#8211; Prerequisites for dbachecks [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/","og_site_name":"dbi Blog","article_published_time":"2020-12-14T16:12:36+00:00","article_modified_time":"2025-10-01T09:49:17+00:00","og_image":[{"width":1064,"height":176,"url":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png","type":"image\/png"}],"author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"Validate your SQL Server infrastructure with dbachecks","datePublished":"2020-12-14T16:12:36+00:00","dateModified":"2025-10-01T09:49:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/"},"wordCount":963,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png","keywords":["dbachecks","infrastructure","SQL Server"],"articleSection":["Database Administration &amp; Monitoring","SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/","url":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/","name":"Validate your SQL Server infrastructure with dbachecks - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png","datePublished":"2020-12-14T16:12:36+00:00","dateModified":"2025-10-01T09:49:17+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/6_GetInstalledModule.png","width":1064,"height":176},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Validate your SQL Server infrastructure with dbachecks"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/15064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=15064"}],"version-history":[{"count":2,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/15064\/revisions"}],"predecessor-version":[{"id":40598,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/15064\/revisions\/40598"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/15066"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=15064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=15064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=15064"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=15064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}