Skip to content

Commit a2d3283

Browse files
Find-DbaInstance - Set TcpConnected=true when SqlConnect succeeds
When a SQL connection is established (or reaches the instance with error class < 25), TCP connectivity is proven. Previously TcpConnected would remain false if the TCPPort scan type was not included in ScanType, even though SqlConnect requires TCP. This fixes the test failure when using ScanType Browser, SqlConnect against SQL Server 2025. Fixes #10322 (do Find-DbaInstance) Co-authored-by: Andreas Jordan <andreasjordan@users.noreply.github.com>
1 parent 8987045 commit a2d3283

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

public/Find-DbaInstance.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ function Find-DbaInstance {
518518
try {
519519
$server = Connect-DbaInstance -SqlInstance $dataSet.SqlInstance -SqlCredential $SqlCredential
520520
$dataSet.SqlConnected = $true
521+
$dataSet.TcpConnected = $true
521522
$dataSet.Confidence = 'High'
522523

523524
# Remove duplicates
@@ -542,6 +543,7 @@ function Find-DbaInstance {
542543
if ($_.Exception.InnerException.Errors.Class -lt 25) {
543544
# There IS an SQL Instance and it listened to network traffic
544545
$dataSet.SqlConnected = $true
546+
$dataSet.TcpConnected = $true
545547
$dataSet.Confidence = 'High'
546548
}
547549
#endregion Processing error (Access denied, server error, ...)

0 commit comments

Comments
 (0)