< Back
New-DbaComputerCertificateSigningRequest
Post
NAME New-DbaComputerCertificateSigningRequest
SYNOPSIS
Creates a new computer certificate signing request. Useful for offline servers and Forcing Encryption.
SYNTAX
New-DbaComputerCertificateSigningRequest [[-ComputerName]
<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>] [[-Credential] <Pscredential>]
[[-ClusterInstanceName] <String>] [[-Path] <String>] [[-FriendlyName] <String>] [[-KeyLength] <Int>] [[-Dns]
<System.String[]>] [-EnableException <Switch>] [<CommonParameters>]
DESCRIPTION
Creates a new computer certificate signing request that is compatible with SQL Server.
By default, a key with a length of 1024 and a friendly name of the machines FQDN is generated.
PARAMETERS
-ClusterInstanceName [<String>]
When creating certs for a cluster, use this parameter to create the certificate for the cluster node name. Use
ComputerName for each of the nodes.
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. If target is a cluster, you must also
specify ClusterInstanceName (see below)
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
-Dns [<System.String[]>]
Specify the Dns entries listed in SAN. By default, it will be ComputerName + FQDN, or in the case of clusters,
clustername + cluster FQDN.
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
-FriendlyName [<String>]
The FriendlyName listed in the certificate. This defaults to the FQDN of the $ComputerName
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-KeyLength [<Int>]
The length of the key - defaults to 1024
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Path [<String>]
The folder to export to.
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:\\>New-DbaComputerCertificate
Creates a computer certificate signing request for the local machine with the keylength of 1024.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>New-DbaComputerCertificate -ComputerName Server1
Creates a computer certificate signing request for server1 with the keylength of 1024.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>New-DbaComputerCertificate -ComputerName sqla, sqlb -ClusterInstanceName sqlcluster -KeyLength 4096
Creates a computer certificate signing request for sqlcluster with the keylength of 4096.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>New-DbaComputerCertificate -ComputerName Server1 -WhatIf
Shows what would happen if the command were run
RELATED LINKS
SYNOPSIS
Creates a new computer certificate signing request. Useful for offline servers and Forcing Encryption.
SYNTAX
New-DbaComputerCertificateSigningRequest [[-ComputerName]
<Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]>] [[-Credential] <Pscredential>]
[[-ClusterInstanceName] <String>] [[-Path] <String>] [[-FriendlyName] <String>] [[-KeyLength] <Int>] [[-Dns]
<System.String[]>] [-EnableException <Switch>] [<CommonParameters>]
DESCRIPTION
Creates a new computer certificate signing request that is compatible with SQL Server.
By default, a key with a length of 1024 and a friendly name of the machines FQDN is generated.
PARAMETERS
-ClusterInstanceName [<String>]
When creating certs for a cluster, use this parameter to create the certificate for the cluster node name. Use
ComputerName for each of the nodes.
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. If target is a cluster, you must also
specify ClusterInstanceName (see below)
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
-Dns [<System.String[]>]
Specify the Dns entries listed in SAN. By default, it will be ComputerName + FQDN, or in the case of clusters,
clustername + cluster FQDN.
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
-FriendlyName [<String>]
The FriendlyName listed in the certificate. This defaults to the FQDN of the $ComputerName
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-KeyLength [<Int>]
The length of the key - defaults to 1024
Required? false
Position? named
Default value
Accept pipeline input? False
Accept wildcard characters? false
-Path [<String>]
The folder to export to.
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:\\>New-DbaComputerCertificate
Creates a computer certificate signing request for the local machine with the keylength of 1024.
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>New-DbaComputerCertificate -ComputerName Server1
Creates a computer certificate signing request for server1 with the keylength of 1024.
-------------------------- EXAMPLE 3 --------------------------
PS C:\\>New-DbaComputerCertificate -ComputerName sqla, sqlb -ClusterInstanceName sqlcluster -KeyLength 4096
Creates a computer certificate signing request for sqlcluster with the keylength of 4096.
-------------------------- EXAMPLE 4 --------------------------
PS C:\\>New-DbaComputerCertificate -ComputerName Server1 -WhatIf
Shows what would happen if the command were run
RELATED LINKS