For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

New-RASCertificate

SYNOPSIS

Creates a Certificate by Importing a Certificate/Pfx file, generating a self-signed certificate or generating a certificate request.

SYNTAX

New-RASCertificate [-Name] <string> [[-SiteId] <uint>] -CommonName <string> -Email <string>
 -RequestFile <string> [-AlternateNames <string>] [-City <string>] [-CountryCode <string>]
 [-Description <string>] [-Enabled <bool>] [-FullStateOrProvince <string>]
 [-KeySize {KeySize1024 | KeySize2048 | KeySize4096 | KeySize3072 | KeySize521 | KeySizeUnknown}]
 [-Organisation <string>] [-OrganisationUnit <string>]
 [-Usage {None | Gateway | HALB | CBAPIServer | CBAPIDataEncryption | CostInsights}]
 [<CommonParameters>]
New-RASCertificate [-Name] <string> [[-SiteId] <uint>] -CommonName <string> -Email <string>
 [-AlternateNames <string>] [-City <string>] [-CountryCode <string>] [-Description <string>]
 [-Enabled <bool>] [-ExpireInMonths <uint>] [-FullStateOrProvince <string>]
 [-KeySize {KeySize1024 | KeySize2048 | KeySize4096 | KeySize3072 | KeySize521 | KeySizeUnknown}]
 [-Organisation <string>] [-OrganisationUnit <string>]
 [-Usage {None | Gateway | HALB | CBAPIServer | CBAPIDataEncryption | CostInsights}]
 [<CommonParameters>]
New-RASCertificate [-Name] <string> [[-SiteId] <uint>] -CertificateFile <string>
 -PrivateKeyFile <string> [-Description <string>] [-Enabled <bool>]
 [-Usage {None | Gateway | HALB | CBAPIServer | CBAPIDataEncryption | CostInsights}]
 [<CommonParameters>]

DESCRIPTION

By default, one is guided to create a Self-Signed Certificate.

A certificate is imported by either specifying a CertificateFile and PrivateKeyFile, or specifying a PfxFile with an optional PfxPassword.

A certificate request can be created by specifying a RequestFile path to output the request to.

EXAMPLES

Example 1

Imports a certificate from the files key.pem and cert.pem to a certificate object with Name "ImportedCert" on Site 1.

Example 2

Imports a certificate from a pfx file cert.pfx to a certificate object with Name "ImportedPfx" on Site 1.

Example 3

Generates a self-signed certificate with Name "SelfSignedCert" on Site 1.

Example 4

Generates a certificate request with Name "CertRequest" on Site 1, and saves the request to req.crt

PARAMETERS

-Name

The name of the target Certificate.

-SiteId

Site ID in which to add the Certificate.

-Description

A user-defined Certificate description.

-PfxFile

Certificate file name in pfx format.

-PfxPassword

The password of the pfx file specified in the PfxFile parameter.

-PrivateKeyFile

Private key file name.

-CertificateFile

Certificate file name.

-Usage

A set of usages to assign. To form a set of usages 'OR' individual usage enum IDs.

Possible values: None, Gateway, HALB, CBAPIServer, CBAPIDataEncryption, CostInsights

Type reference: CertificateUsages

-Enabled

Whether to enable or disable the certificate being created.

-KeySize

The Key Size for the certificate to be generated.

Possible values: KeySize1024, KeySize2048, KeySize4096, KeySize3072, KeySize521, KeySizeUnknown

Type reference: CertificateKeySize

-CountryCode

The Country Code for the certificate to be generated.

By default, the country code from the PowerShell region information is used.

-ExpireInMonths

Specifies the length of validity of the certificate being generated.

-FullStateOrProvince

The Full State or Province for the certificate to be generated.

-City

The City for the certificate to be generated.

-Organisation

The Organisation for the certificate to be generated.

-OrganisationUnit

The Organisation Unit for the certificate to be generated.

-Email

The Email for the certificate to be generated.

-CommonName

The Common Name for the certificate to be generated.

-AlternateNames

The Alternate Names for the certificate to be generated.

eg. IP:1.2.3.4,DNS:example.com

-RequestFile

Request file name to output Request Certificate to.

-LetsEncrypt

Let's Encrypt SwitchParameter

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None

OUTPUTS

Certificate

Last updated