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

Trust Server Certificate Switch #9

Open
mattmcnabb opened this issue Feb 23, 2017 · 4 comments
Open

Trust Server Certificate Switch #9

mattmcnabb opened this issue Feb 23, 2017 · 4 comments

Comments

@mattmcnabb
Copy link
Contributor

mattmcnabb commented Feb 23, 2017

I've been using a modified version of Invoke-SqlCmd2 with an added switch -TrustServerCertificate for cases where the cert returned is not in the local trusted store. Generally I've used this for testing with a self-signed cert. Do you see any value in adding this to Invoke-SqlCmd2?

$FormatValues = $SQLInstance,$Database,$Credential.UserName,$Credential.GetNetworkCredential().Password,$ConnectionTimeout,$Encrypt,$TrustServerCertificate
$ConnectionString = "Server={0};Database={1};User ID={2};Password=`"{3}`";Trusted_Connection=False;Connect Timeout={4};Encrypt={5};TrustServerCertificate={6}" -f $FormatValues
@alevyinroc
Copy link
Contributor

@mattmcnabb I have basic support for adding this parameter to the connection string in my branch https://github.com/alevyinroc/Invoke-SqlCmd2/tree/Fix-009

When my previous PR is approved & merged into master, I can do a PR to get that change merged in as well. I don't have a good way to test this at the moment though.

@RamblingCookieMonster can you please assign to me?

@mbourgon
Copy link

Howdy, @alevyinroc , did this ever get rolled in? I'm looking at the current version, and I don't see the trustservercertificate code in there, though obviously it's in yours. Just wondering if I need to just use the version in Fix-009 instead. Thanks!

@alevyinroc
Copy link
Contributor

@mbourgon It has not. I honestly had forgotten about this, it's been over 5 years now. I suspect most if not all of this module's functionality has been consumed into dbatools's Invoke-DbaQuery, making this obsolete.

@mbourgon
Copy link

Not terribly surprised, but wanted to make sure.

Honestly, we have servers that get the bare minimum done to them. Patched, migrated when the OS falls out of extended support, and that’s it. This code has been a lifesaver over the years because it has zero dependencies on anything else. So I’m still able to use it on pretty much any server in our environment without any installs or Change Requests or restarts. I’ll use this one, then. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants