< Back

Get-DbaComputerCertificate

Mon Jan 13, 2020 10:27 am

NAME Get-DbaComputerCertificate



SYNOPSIS

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





SYNTAX

Get-DbaComputerCertificate [[-ComputerName] <Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]

[[-Credential] <Pscredential>] [[-Store] <System.String[]>] [[-Folder] <System.String[]>] [[-Type] <String>]

[[-Path] <String>] [[-Thumbprint] <System.String[]>] [-EnableException <Switch>] [<CommonParameters>]





DESCRIPTION

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





PARAMETERS

-ComputerName [<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>]

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

the distinct nodes.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Credential [<Pscredential>]

Allows you to login to $ComputerName using alternative credentials.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Folder [<System.String[]>]

Certificate folder - defaults to My (Personal)



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Path [<String>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Store [<System.String[]>]

Certificate store - defaults to LocalMachine



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Thumbprint [<System.String[]>]

Return certificate based on thumbprint



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Type [<String>]

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



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Certificate

Author: Chrissy LeMaire (@cl), netnerds.net



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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



RELATED LINKS