dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

-TrustServerCertificate in Export-DbaLinkedServer

Open MetaSeb opened this issue 9 months ago • 2 comments

Summarize Functionality

Hello,

Will it be possible to have the -TrustServerCertificate option in the Export-DbaLinkedServer command to bypass certificate verification on an old server ?

Thank you !

Is there a command that is similiar or close to what you are looking for?

Yes

Technical Details

When I run the following command :

Export-DbaLinkedServer -SqlInstance MySQLServer -Path C:\TEMP\SQL\server_link.sql

I am getting the following error :

WARNING: [11:46:12][Export-DbaLinkedServer] Failure | Échec de la validation de la chaîne du certificat. Erreur(s) : « Une chaîne de certificats a été traitée m ais s'est terminée par un certificat racine qui n'est pas approuvé par le fourni sseur d'approbation., [Status: UntrustedRoot]  ». Incompatibilité de nom de certificat. La valeur 'DataSource' ou 'HostNameInCerti ficate' fournie ne correspond pas au nom dans le certificat.

If I use the command :

Connect-DbaInstance -SqlInstance MySQLServer -SqlCredential user -TrustServerCertificate

This one works fine without the certificate error.

Thank you ! 👍

MetaSeb avatar Feb 26 '26 10:02 MetaSeb

You have to use Connect-DbaInstance first, there is the needed parameter. Then you can use that result as SqlInstance in the export command.

andreasjordan avatar Feb 26 '26 12:02 andreasjordan

OK, thank you very much for the information !

MetaSeb avatar Feb 26 '26 12:02 MetaSeb