Set-VIMachineCertificate
This cmdlet sets a machine SSL certificate to a vCenter Server instance or a connected ESXi host.By default, the certificate is set to the vCenter Server instance. If you want to set the certificate to a specific ESXi host, you must use the VMHost parameter.The result from the command is the updated vCenter Server or ESXi entity with the certificate that was set.To use this cmdlet, you must connect to vCenter Server through the Connect-VIServer cmdlet.IMPORTANT: When you change the machine SSL certificate of a vCenter Server system, a restart is triggered.
Syntax
[-PemCertificate <String>]
[-PemKey <String>]
[-Server <VIServer>]
[-X509Certificate <X509Certificate>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
optional |
|
AsymmetricAlgorithm | named |
|
Specifies the private key as AsymmetricAlgorithm type of the certificate that you want to set. Note: To use this parameter, you must have PowerShell version 7.1 or later. | optional |
|
String | named |
|
Specifies a certificate in PEM format to be set as the machine SSL certificate to a vCenter Server instance or an ESXi host. | optional |
|
String | named |
|
Specifies the private key in PEM format of the certificate that you want to set to a vCenter Server system. | optional |
|
VIServer | named |
|
optional |
|
X509Certificate | named |
|
Specifies a certificate as an X509Certificate object to be set as the machine SSL certificate to a vCenter Server instance or an ESXi host. |
[-PemCertificate <String>]
[-Server <VIServer>]
[-X509Certificate <X509Certificate>]
[CommonParameters]
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required |
|
VMHost | named |
|
Specifies the ESXi host to which you want to set a machine SSL certificate. | optional |
|
String | named |
|
Specifies a certificate in PEM format to be set as the machine SSL certificate to a vCenter Server instance or an ESXi host. | optional |
|
VIServer | named |
|
optional |
|
X509Certificate | named |
|
Specifies a certificate as an X509Certificate object to be set as the machine SSL certificate to a vCenter Server instance or an ESXi host. |
Output
Examples
Example 1
Sets the certificate from the cert.pem file to the vCenter Server system.
Example 2
Sets the certificate from the cert.pem file to the 'MyHost' ESXi host.
Related Commands
VIMachineCertificate