Copy-DbaLinkedServer - Add DAC connection to prevent multiple DAC connection attempts#9921
Merged
potatoqualitee merged 1 commit intodevelopmentfrom Nov 3, 2025
Merged
Conversation
…nection attempts This fix addresses issue #9204 where Sync-DbaAvailabilityGroup was causing 3 failed DAC connection errors in SQL Server logs. Root cause: Copy-DbaLinkedServer was not opening a DAC connection like Copy-DbaCredential does. When Get-DecryptedObject was called without an existing DAC connection, it attempted to open its own DAC connection, causing conflicts when both credentials and linked servers needed to be synced. Changes: - Added -DedicatedAdminConnection parameter to Connect-DbaInstance call (line 286) - Added verbose message about opening DAC connection (line 285) - Added end block to properly disconnect DAC connection (lines 322-326) This ensures Copy-DbaLinkedServer follows the same pattern as Copy-DbaCredential, opening a DAC connection upfront that Get-DecryptedObject will detect and reuse. Co-authored-by: Andreas Jordan <[email protected]>
Member
|
LGTM! Thank you, Andreas 🙏🏼 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes issue #9204 where
Sync-DbaAvailabilityGroupwas causing 3 failed DAC connection errors in SQL Server logs.Root Cause
Copy-DbaLinkedServerwas not opening a DAC connection likeCopy-DbaCredentialdoes. WhenGet-DecryptedObjectwas called without an existing DAC connection, it attempted to open its own DAC connection, causing conflicts when both credentials and linked servers needed to be synced.Changes
-DedicatedAdminConnectionparameter toConnect-DbaInstancecall in Copy-DbaLinkedServer.ps1 (line 286)endblock to properly disconnect DAC connection (lines 322-326)This ensures
Copy-DbaLinkedServerfollows the same pattern asCopy-DbaCredential, opening a DAC connection upfront thatGet-DecryptedObjectwill detect and reuse.Fixes #9204
🤖 Generated with Claude Code