commands

^

Get-DbaComputerCertificate

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Get-DbaComputerCertificate on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaComputerCertificate.

Synopsis

Simplifies finding computer certificates that are candidates for using with SQL Server's network encryption

Description

Gets computer certificates on localhost that are candidates for using with SQL Server's network encryption

Syntax

Get-DbaComputerCertificate
    [[-ComputerName] <DbaInstanceParameter[]>]
    [[-Credential] <PSCredential>]
    [[-Store] <String[]>]
    [[-Folder] <String[]>]
    [[-Type] <String>]
    [[-Path] <String>]
    [[-Thumbprint] <String[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaComputerCertificate

Gets computer certificates on localhost that are candidates for using with SQL Server's network encryption

Example: 2
PS C:\> Get-DbaComputerCertificate -ComputerName sql2016

Gets computer certificates on sql2016 that are candidates for using with SQL Server's network encryption

Example: 3
PS C:\> Get-DbaComputerCertificate -ComputerName sql2016 -Thumbprint 8123472E32AB412ED4288888B83811DB8F504DED, 04BFF8B3679BB01A986E097868D8D494D70A46D6

Gets computer certificates on sql2016 that match thumbprints 8123472E32AB412ED4288888B83811DB8F504DED or 04BFF8B3679BB01A986E097868D8D494D70A46D6

Optional Parameters

-ComputerName

The target SQL Server instance or instances. Defaults to localhost. If target is a cluster, you must specify the distinct nodes.

Alias
Required False
Pipeline true (ByValue)
Default Value $env:COMPUTERNAME
-Credential

Allows you to login to $ComputerName using alternative credentials.

Alias
Required False
Pipeline false
Default Value
-Store

Certificate store - defaults to LocalMachine

Alias
Required False
Pipeline false
Default Value LocalMachine
-Folder

Certificate folder - defaults to My (Personal)

Alias
Required False
Pipeline false
Default Value My
-Type

The type of certificates to return. All or Service. Default is Service since this is SQL specific.

Alias
Required False
Pipeline false
Default Value Service
Accepted Values All,Service
-Path

The path to a certificate - basically changes the path into a certificate object

Alias
Required False
Pipeline false
Default Value
-Thumbprint

Return certificate based on thumbprint

Alias
Required False
Pipeline false
Default Value
-EnableException

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message. This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting. Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.

Alias
Required False
Pipeline false
Default Value False