I am working with a customer that has a large number of hosts in several vCenter environments. In troubleshooting some issues due to a recent upgrade to VCenter 6.0 U3, I have a need to verify the vCenter agent version on each of the hosts. I can certainly login manually to each one and do something like this:
rpm -qa | grep vpxa
But I would much rather be able to do it through a script. Just curious if this is feasible. I can connect to the hosts in a look and get the appropriate service:
Connect-VIServer -Server MyESXi -User myRootUser -Password myPassword
Get-VMHostService |
Where {$_.Key -eq "vpxa"}
However I do not see a way to grab the version info. Hoping I am missing something stupid-simple that someone could point out.
Would this work?
foreach($esx in Get-VMHost){
$esxcli = Get-EsxCli -VMHost $esx -V2
$esxcli.software.vib.get.Invoke() | where{$_.Name -eq 'vmware-fdm'} |
Select @{N='VMHost';E={$esx.Name}},Name,Version,InstallDate
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Would this work?
foreach($esx in Get-VMHost){
$esxcli = Get-EsxCli -VMHost $esx -V2
$esxcli.software.vib.get.Invoke() | where{$_.Name -eq 'vmware-fdm'} |
Select @{N='VMHost';E={$esx.Name}},Name,Version,InstallDate
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks, that looks great. I am guessing if this VIB shows an install date that correlates with the date of the vCenter upgrade it is a fair bet the vpxa agent was updated as well?
Yes, that's what I would assume as well.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
