Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add-DbaRegServer: Settings "Encrypt Connection" and "Trust server certificate" not saved when using CMS #9301

Open
fm-knopfler opened this issue Mar 28, 2024 · 1 comment
Labels
bugs life triage required New issue that has not been reviewed by maintainers

Comments

@fm-knopfler
Copy link

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

Using Add-DbaRegServer to register an instance to a Central Management Server, it's connection settings aren't saved. When registering to a Local Server Group, connection settings are saved. This is visible in SSMS.

Steps to Reproduce

$cmsInstance = "server01.example.org\MGMT" 
$server = "server04.example.org\SQL001"

# Local Server Groups, connection settings are applied
Connect-dbaInstance -SqlInstance $server -EncryptConnection -TrustServerCertificate | Add-DbaRegServer -Name "TST01" -Group "Test"

# CMS, connections settings not applied
Connect-dbaInstance -SqlInstance $server -EncryptConnection -TrustServerCertificate | Add-DbaRegServer -Name "TST01" -SqlInstance $cmsInstance -Group "Test"

SSMS

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

2.1.11

Other details or mentions

No response

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

Name Value


PSVersion 5.1.17763.5576
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.5576
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 2019 (RTM-CU25) (KB5033688) - 15.0.4355.3 (X64) Jan 30 2024 17:02:22 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2019 Standard 10.0 (Build 17763: ) (Hypervisor)

.NET Framework Version

PSChildName Version


Client 4.8.03761
Full 4.8.03761
Client 4.0.0.0

@fm-knopfler fm-knopfler added bugs life triage required New issue that has not been reviewed by maintainers labels Mar 28, 2024
@460163
Copy link

460163 commented May 7, 2024

I have the exact same issue, but I am trying to register the server on a remote CMS. When I use the code below, the Trust Server Certificate is not enabled.

dbtools v2.1.14
Powershell v7.4.2

Here is the code:
$ConnString = New-DbaConnectionString -TrustServerCertificate -SqlInstance $InstanceName
Add-DbaRegServer -SqlInstance $RegInstance -SqlInstance $InstanceName -ConnectionString $ConnString -Group $Group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugs life triage required New issue that has not been reviewed by maintainers
Projects
None yet
Development

No branches or pull requests

2 participants