< Back

Add-DbaComputerCertificate

Mon Jan 13, 2020 9:09 am

NAME Add-DbaComputerCertificate



SYNOPSIS

Adds a computer certificate - useful for older systems.





SYNTAX

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

[[-Credential] <Pscredential>] [[-SecurePassword] <Securestring>] [[-Certificate]

<System.Security.Cryptography.X509Certificates.X509Certificate2[]>] [[-Path] <String>] [[-Store] <String>]

[[-Folder] <String>] [-EnableException <Switch>] [<CommonParameters>]





DESCRIPTION

Adds a computer certificate from a local or remote computer.





PARAMETERS

-Certificate [<System.Security.Cryptography.X509Certificates.X509Certificate2[]>]

The target certificate object.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



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

The target SQL Server instance or instances. Defaults to localhost.



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 [<String>]

Certificate folder. Default is My (Personal).



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Path [<String>]

The local path to the target certificate object.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SecurePassword [<Securestring>]

The password for the certificate, if it is password protected.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Store [<String>]

Certificate store. Default is LocalMachine.



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:\\>Add-DbaComputerCertificate -ComputerName Server1 -Path C:\\temp\\cert.cer



Adds the local C:\\temp\\cert.cer to the remote server Server1 in LocalMachine\\My (Personal).

-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Add-DbaComputerCertificate -Path C:\\temp\\cert.cer



Adds the local C:\\temp\\cert.cer to the local computer's LocalMachine\\My (Personal) certificate store.



RELATED LINKS