From b9ce30d67ddcf307cd27c1c2dec2dd2f0f76bce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Doma=C5=84ski?= Date: Fri, 12 Jun 2026 06:24:00 +0000 Subject: [PATCH] Jun 12, 2026, 8:24 AM --- toolbox/Modules/SQLManager.psm1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/toolbox/Modules/SQLManager.psm1 b/toolbox/Modules/SQLManager.psm1 index 6f1cf2d..48dd231 100644 --- a/toolbox/Modules/SQLManager.psm1 +++ b/toolbox/Modules/SQLManager.psm1 @@ -16,6 +16,15 @@ function Import-DBAToolBoxDependencies { if (-not (Get-Module dbatools)) { Import-Module dbatools -ErrorAction Stop } + + # Configure dbatools to trust server certificates to prevent SSL/TLS certificate name mismatch / untrusted chain issues + try { + if (Get-Command Set-DbatoolsConfig -ErrorAction SilentlyContinue) { + Set-DbatoolsConfig -FullName 'sql.connection.trustcert' -Value $true -ErrorAction SilentlyContinue + } + } catch { + # Fallback if configuration cmdlet is not available + } } function Test-SQLConnection {