# New-RASCertificate

### NAME

New-RASCertificate\ <br>

### SYNOPSIS

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

### SYNTAX

New-RASCertificate \[-[Name](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Name)] *\<string>* \[\[-[SiteId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#SiteId)] *\<uint>*] -[CommonName](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonName) *\<string>* -[Email](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Email) *\<string>* -[RequestFile](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#RequestFile) *\<string>* \[-[AlternateNames](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#AlternateNames) *\<string>*] \[-[City](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#City) *\<string>*] \[-[CountryCode](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CountryCode) *\<string>*] \[-[Description](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Description) *\<string>*] \[-[Enabled](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Enabled) *\<bool>*] \[-[FullStateOrProvince](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#FullStateOrProvince) *\<string>*] \[-[KeySize](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#KeySize) {KeySize1024 | KeySize2048 | KeySize4096 | KeySize3072 | KeySize521 | KeySizeUnknown}] \[-[Organisation](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Organisation) *\<string>*] \[-[OrganisationUnit](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#OrganisationUnit) *\<string>*] \[-[Usage](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Usage) {None | Gateway | HALB}] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonParameters)*>*]\
\
New-RASCertificate \[-[Name](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Name)] *\<string>* \[\[-[SiteId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#SiteId)] *\<uint>*] -[CommonName](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonName) *\<string>* -[Email](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Email) *\<string>* \[-[AlternateNames](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#AlternateNames) *\<string>*] \[-[City](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#City) *\<string>*] \[-[CountryCode](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CountryCode) *\<string>*] \[-[Description](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Description) *\<string>*] \[-[Enabled](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Enabled) *\<bool>*] \[-[ExpireInMonths](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#ExpireInMonths) *\<uint>*] \[-[FullStateOrProvince](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#FullStateOrProvince) *\<string>*] \[-[KeySize](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#KeySize) {KeySize1024 | KeySize2048 | KeySize4096 | KeySize3072 | KeySize521 | KeySizeUnknown}] \[-[Organisation](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Organisation) *\<string>*] \[-[OrganisationUnit](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#OrganisationUnit) *\<string>*] \[-[Usage](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Usage) {None | Gateway | HALB}] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonParameters)*>*]\
\
New-RASCertificate \[-[Name](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Name)] *\<string>* \[\[-[SiteId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#SiteId)] *\<uint>*] -[CertificateFile](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CertificateFile) *\<string>* -[PrivateKeyFile](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#PrivateKeyFile) *\<string>* \[-[Description](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Description) *\<string>*] \[-[Enabled](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Enabled) *\<bool>*] \[-[Usage](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Usage) {None | Gateway | HALB}] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonParameters)*>*]\
\
New-RASCertificate \[-[Name](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Name)] *\<string>* \[\[-[SiteId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#SiteId)] *\<uint>*] -[PfxFile](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#PfxFile) *\<string>* \[-[Description](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Description) *\<string>*] \[-[Enabled](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Enabled) *\<bool>*] \[-[PfxPassword](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#PfxPassword) *\<SecureString>*] \[-[Usage](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Usage) {None | Gateway | HALB}] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonParameters)*>*]\
\
New-RASCertificate \[-[Name](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Name)] *\<string>* \[\[-[SiteId](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#SiteId)] *\<uint>*] -[CommonName](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonName) *\<string>* -[Email](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Email) *\<string>* -[LetsEncrypt](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#LetsEncrypt) *\<SwitchParameter>* \[-[AlternateNames](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#AlternateNames) *\<string>*] \[-[City](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#City) *\<string>*] \[-[CountryCode](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CountryCode) *\<string>*] \[-[Description](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Description) *\<string>*] \[-[Enabled](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Enabled) *\<bool>*] \[-[FullStateOrProvince](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#FullStateOrProvince) *\<string>*] \[-[KeySize](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#KeySize) {KeySize1024 | KeySize2048 | KeySize4096 | KeySize3072 | KeySize521 | KeySizeUnknown}] \[-[Organisation](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Organisation) *\<string>*] \[-[OrganisationUnit](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#OrganisationUnit) *\<string>*] \[-[Usage](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#Usage) {None | Gateway | HALB}] \[*<*[*CommonParameters*](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/cmdlets/New-RASCertificate.html#CommonParameters)*>*]\ <br>

### 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.\ <br>

### PARAMETERS

\
-**Name \<string>**\
The name of the target Certificate.\ <br>

```
        Required?                    true
```

```
        Position?                    0
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**SiteId \<uint>**\
Site ID in which to add the Certificate.\ <br>

```
        Required?                    false
```

```
        Position?                    1
```

```
        Default value                0
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Description \<string>**\
A user-defined Certificate description.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**PfxFile \<string>**\
Certificate file name in pfx format.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**PfxPassword \<SecureString>**\
The password of the pfx file specified in the PfxFile parameter.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**PrivateKeyFile \<string>**\
Private key file name.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**CertificateFile \<string>**\
Certificate file name.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Usage <**[**CertificateUsages**](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/CertificateUsages.html)**>**\
A set of usages to assign. To form a set of usages 'OR' individual usage enum IDs.\
\
Possible values: None, Gateway, HALB\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                Gateway, HALB
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Enabled \<bool>**\
Whether to enable or disable the certificate being created.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                True
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**KeySize <**[**CertificateKeySize**](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/CertificateKeySize.html)**>**\
The Key Size for the certificate to be generated.\
\
Possible values: KeySize1024, KeySize2048, KeySize4096, KeySize3072, KeySize521, KeySizeUnknown\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                KeySize2048
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**CountryCode \<string>**\
The Country Code for the certificate to be generated.\
\
By default, the country code from the PowerShell region information is used.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                US
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**ExpireInMonths \<uint>**\
Specifies the length of validity of the certificate being generated.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                12
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**FullStateOrProvince \<string>**\
The Full State or Province for the certificate to be generated.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**City \<string>**\
The City for the certificate to be generated.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Organisation \<string>**\
The Organisation for the certificate to be generated.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**OrganisationUnit \<string>**\
The Organisation Unit for the certificate to be generated.\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**Email \<string>**\
The Email for the certificate to be generated.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**CommonName \<string>**\
The Common Name for the certificate to be generated.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**AlternateNames \<string>**\
The Alternate Names for the certificate to be generated.\
\
eg. IP:1.2.3.4,DNS:example.com\ <br>

```
        Required?                    false
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**RequestFile \<string>**\
Request file name to output Request Certificate to.\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                
```

```
        Accept pipeline input?       false
```

```
        Accept wildcard characters?  false
```

\
-**LetsEncrypt \<SwitchParameter>**\
Let's Encrypt SwitchParameter\ <br>

```
        Required?                    true
```

```
        Position?                    named
```

```
        Default value                False
```

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

<br>

### INPUTS

-none-

### OUTPUTS

[Certificate](https://download.parallels.com/ras/v19/docs/en_US/Parallels-RAS-v19-PowerShell-Guide/RASAdmin/types/Certificate.html)

### EXAMPLES

\
\&#xNAN;**---------- EXAMPLE 1 ----------**\
\
New-RASCertificate -Name "ImportedCert" -SiteId 1 -Description "Certificate" -Usage Gateway -Enabled $true -PrivateKeyFile "C:\key.pem" -CertificateFile "C:\cert.pem"\
\
Imports a certificate from the files key.pem and cert.pem to a certificate object with Name "ImportedCert" on Site 1.\
\&#xNAN;**---------- EXAMPLE 2 ----------**\
\
New-RASCertificate -Name "ImportedPfx" -SiteId 1 -Description "Certificate" -Usage Gateway -Enabled $true -PfxFile "C:\cert.pfx" -PfxPassword $pfxPassword\
\
Imports a certificate from a pfx file cert.pfx to a certificate object with Name "ImportedPfx" on Site 1.\
\&#xNAN;**---------- EXAMPLE 3 ----------**\
\
New-RASCertificate -Name "SelfSignedCert" -SiteId 1 -Description "Certificate" -Usage Gateway -Enabled $true -Email "<test@parallels.com>" -CommonName "TestCert" -AlternateNames "DNS:\*.example.com,IP:1.2.3.4,IP:::1"\
\
Generates a self-signed certificate with Name "SelfSignedCert" on Site 1.\
\&#xNAN;**---------- EXAMPLE 4 ----------**\
\
New-RASCertificate -Name "CertRequest" -SiteId 1 -Description "Certificate" -Usage Gateway -Enabled $true -Email "<test@parallels.com>" -CommonName "TestCert" -RequestFile "C:\req.crt" -AlternateNames "DNS:example.com,IP:1.2.3.4,IP:::1"\
\
Generates a certificate request with Name "CertRequest" on Site 1, and saves the request to req.crt
