Skip to content

DAC behaviour in Connect-DbaInstance on localhost #10151

@Phaere

Description

@Phaere

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

Export-DbaLinkedServer in specific cases keeps spamming in the SQL server log with error below:
"Could not connect because the maximum number of '1' dedicated administrator connections already exists. Before a new connection can be made, the existing dedicated administrator connection must be dropped, either by logging off or ending the process."

Steps to Reproduce

  1. Connect to SQL server via RDP or PSRemoteSession
  2. Run Export-DbaLinkedServer -SqlInstance SERVERNAME -LinkedServer LINKEDNAME
  3. Look at SQL server logs, you should see error about multiple DAC connections not allowed
  4. Issue does not reproduce when command executed from another PC, only at SQL server itself

Please confirm that you are running the most recent version of dbatools

2.7.23-2.7.25

Other details or mentions

Issue exists in Connect-DbaInstance function called from Export-DbaLinkedServer with $DedicatedAdminConnection parameter.
It builds up connection string to servername passed from user input and produces multiple connections attempts to all resolved IP addresses.

Image In #10106 issue was fixed for all connections from outside, but still persist when dbatools executed locally.

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

Name Value


PSVersion 5.1.20348.4294
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.4294
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

SQL Server Edition and Build number

Microsoft SQL Server 2022 (RTM-CU20) (KB5059390) - 16.0.4205.1 (X64) Jun 13 2025 13:38:45 Copyright (C) 2022 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2022 Datacenter 10.0 (Build 20348: )

.NET Framework Version

PSChildName Version


Client 4.8.04161
Full 4.8.04161
Client 4.0.0.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions