dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Set-DbaNetworkCertificate

Sets the network certificate for SQL Server instance. This setting is found in Configuration Manager.

This command also grants read permissions for the service account on the certificate’s private key.

References:
SQL Magazine
Jppp
MSDN Blog

Screenshots

dbatools-Set-DbaNetworkCertificate

Examples

Creates and imports a new certificate signed by an Active Directory CA on localhost then sets the network certificate for the SQL2008R2SP2 to that newly created certificate.

New-DbaComputerCertificate | Set-DbaNetworkCertificate -SqlInstance localhost\SQL2008R2SP2

Sets the network certificate for the SQL2008R2SP2 instance to the certificate with the thumbprint of 1223FB1ACBCA44D3EE9640F81B6BA14A92F3D6E2 in LocalMachine\My on sql1.

Set-DbaNetworkCertificate -SqlInstance sql1\SQL2008R2SP2 -Thumbprint 1223FB1ACBCA44D3EE9640F81B6BA14A92F3D6E2

Author

This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.

Get-Help

From PowerShell, execute Get-Help Set-DbaNetworkCertificate -Detailed for more information on this function.

Source Code

Want to see the source code? View Set-DbaNetworkCertificate.ps1 on GitHub
 

Related commands