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 {