Password decryption commands - Document the remote DAC prerequisite - #10551
Draft
andreasjordan wants to merge 1 commit into
Draft
Password decryption commands - Document the remote DAC prerequisite#10551andreasjordan wants to merge 1 commit into
andreasjordan wants to merge 1 commit into
Conversation
Up to dbatools 2.7, Get-DecryptedObject opened a local DAC itself from inside the PowerShell remoting session on the SQL Server host, so no remote DAC was needed. PR #10174 removed that path so a single DAC can be opened early and shared, because SQL Server allows only one DAC per instance. That refactor was deliberate, but it changed the network requirement from "PowerShell remoting only" to "PowerShell remoting plus a reachable remote DAC", and nothing in the help said so. Documents the current state in the eight affected commands and in Get-DecryptedObject: what the two connections are, that the DAC is opened from the client and therefore needs remote admin connections enabled and a reachable DAC port, and that -ExcludePassword avoids both. Also corrects two statements that no longer hold: - Copy-DbaCredential claimed "DAC access enabled for local (default)" - Export-DbaLinkedServer said it "accesses the local registry" No behaviour change - help only. Whether the code should also regain a local-DAC path is the open question on the issue, deliberately not answered here. Refs #10549 (do Copy-DbaCredential, Copy-DbaDbMail, Copy-DbaLinkedServer, Export-DbaCredential, Export-DbaInstance, Export-DbaLinkedServer, Start-DbaMigration, Sync-DbaAvailabilityGroup) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Draft, to show what the documentation-only option from #10549 actually looks like. The design question on that issue is still open — this PR deliberately does not answer it.
Problem
Up to dbatools 2.7,
Get-DecryptedObjectopened the DAC itself, from inside the PowerShell remoting session on the SQL Server host (ADMIN:127.0.0.1\<instance>). That is a local DAC: it needs neitherremote admin connectionsnor a reachable DAC port.PR #10174 removed that path so that a single DAC can be opened early and shared across every command that needs one — SQL Server allows only one DAC per instance, and the per-command open/close pattern was the root of #10040, #9921 and #10475.
The refactor was intended. The side effect was not documented: the requirement changed from "PowerShell remoting to the host" to "PowerShell remoting plus a remote DAC". Reporters hit this as a silent failure, most recently in #10549.
What changed
Help only — no behaviour change, no code touched.
Added to the
.DESCRIPTIONof the five commands that decrypt passwords directly (Export-DbaLinkedServer,Export-DbaCredential,Copy-DbaLinkedServer,Copy-DbaCredential,Copy-DbaDbMail) a short block naming both connections:The three orchestrators (
Export-DbaInstance,Start-DbaMigration,Sync-DbaAvailabilityGroup) get a shorter version that also states they open one shared DAC and hand it down, and points at the underlying commands.Sync-DbaAvailabilityGroupalready explained the shared DAC; only the network prerequisite was missing.Every
-ExcludePasswordparameter now says it is also the way out when the DAC or remoting is unavailable, since the command then needs neither.Get-DecryptedObjectrecords why it no longer opens a DAC itself, so the next person to read it does not have to reconstruct the history from git.Two statements that are no longer true are corrected:
Copy-DbaCredentiallistedDAC access enabled for local (default)underRequires:— the opposite of what it needs nowExport-DbaLinkedServersaid it "accesses the local registry"; the registry read happens on the SQL Server host, not locallyWhat deliberately did not change
No code. Whether
Get-DecryptedObjectshould regain a local-DAC-over-remoting path is the question put to contributors on #10549. Reintroducing a second DAC path costs reliability in an area that took several releases to stabilise, so it should be a decision, not a side effect of this PR.Invoke-DbaDbDecryptObjectalso opens a DAC but is untouched — it needs one for the encrypted object definitions themselves and has no remoting leg to route through, so the requirement there is inherent rather than a consequence of the refactor.Testing
Get-Helprenders the new text on all 8 commandsReported and diagnosed by @edbmfo in #10549, whose analysis of the
127.0.0.1change and its removal was correct in every detail.