Hi,
I need to refresh ca certs in host after I publish my certs. The below command is not working. It works only when I manually refresh it from the UI. I need to automate this using powercli. So kind suggest if there is any way.
/usr/lib/vmware-vmafd/bin/vecs-cli force-refresh
Try like this
$si = Get-View ServiceInstance
$certMgr = Get-View -Id $si.Content.CertificateManager
Get-VMHost | ForEach-Object -Process {
$certMgr.CertMgrRefreshCACertificatesAndCRLs($_.Id)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can take a look at the PowerCLI function at the below Site which might be helpful for your requirement.
https://vmwarecode.com/2020/07/11/renew-esxi-vmca-certificate/
that is for Renew. I need for Refresh (Refresh CA certificates)
Try like this
$si = Get-View ServiceInstance
$certMgr = Get-View -Id $si.Content.CertificateManager
Get-VMHost | ForEach-Object -Process {
$certMgr.CertMgrRefreshCACertificatesAndCRLs($_.Id)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks a lot.. it worked..
For future reference
https://kb.vmware.com/s/article/80461