Sridharan13
Contributor
Contributor

Refresh CA Certificates on Host using PowerCli

Jump to solution

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

Labels (1)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

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

View solution in original post

4 Replies
mrtgokul
Contributor
Contributor

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/ 

0 Kudos
Sridharan13
Contributor
Contributor

that is for Renew. I need for Refresh (Refresh CA certificates) 

Tags (1)
0 Kudos
LucD
Leadership
Leadership

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

Sridharan13
Contributor
Contributor

Thanks a lot.. it worked..
For future reference
https://kb.vmware.com/s/article/80461

Tags (1)
0 Kudos