VI Machine Certificate Category
Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations
Step 1: Retrieve a object by running a Get command
# Retrieve the machine certificate of the vCenter Server system and its ESXi hosts.
Get-VIMachineCertificate
Step 2 : Run commands from the CRUD group
# Creates a CSR for the vCenter Server instance and saves it in the 'csr' variable. You can get the certificate request in PEM format by evaluating $csr.CertificateRequestPEM.
$csr = New-VIMachineCertificateSigningRequest ` -Country 'US' ` -Email '[email protected]' ` -Locality 'Example Town' ` -Organization 'Example organization' ` -OrganizationUnit 'Example organization unit' ` -StateOrProvince 'Example state'
# Sets the certificate from the cert.pem file to the vCenter Server system.
$certificatePem = Get-Content cert.pem -Raw PS C:\> Set-VIMachineCertificate -PemCertificate $certificatePem