VMware: Renew an ESXi host certificate by PowerCli

Hi,

these are the steps to renew a ESXi Host certificate signed by the vCenter VMCA by PowerCli.

PS D:> Connect-VIServer myVCenter.myDomain.org
PS D:> $oVMHost=Get-VMHost myESXiHost01.myDomain.org
PS D:> $oHostParameters = New-Object VMware.Vim.ManagedObjectReference[] (1)
PS D:> $oHostParameters[0] = New-Object VMware.Vim.ManagedObjectReference
PS D:> $oHostParameters[0].Type = 'HostSystem'
PS D:> $oHostParameters[0].Value = $oVMHost.ExtensionData.MoRef.Value
PS D:> $oCertManager=Get-View -Id CertificateManager-certificateManager

Start the renew process asynchronous

PS D:> $oCertManager.CertMgrRefreshCertificates_Task($oHostParameters)

Or synchronous

PS D:> $oCertManager..CertMgrRefreshCertificates($oHostParameters)

Michael

Leave a Reply