Problem:
I needed a quick way to find all VMware ESXi hosts that were affected by a particular driver vulnerability.
Solution:
Connect to ESXi host using PowerCLI:
Connect-VIServer vCenter01
Run the below command to return all hosts within cluster001 that have the HPE qflef3 NIC driver:
get-cluster 'Cluster001' | get-vmhost | % { $vmhost = $_.name; (get-esxcli -vmhost $_).system.module.list() | where name -eq qfle3f | select @{l='vmhost';e={$vmhost}}, Name, IsEnabled, IsLoaded }
Run the below command to return all hosts that have the qfle3 NIC driver and show the version number:
get-vmhost | % { $vmhost = $_.name; $esxcli = get-esxcli -vmhost $_; $esxcli.system.module.list() | where name -eq qfle3f | select @{l='vmhost';e={$vmhost}}, Name, IsEnabled, IsLoaded, @{N="qfle3 version";E={$esxcli.system.module.get("qfle3").version}} } | ft -auto