VMware Cloud Community
johndavidd
Enthusiast
Enthusiast

eNIC Driver Verison and VEM Module Version

The ESXi Host API Version is 4.1 so I cannot use Get-ESXCli

I want to use PowerCLI to get these two values. Any ideas on this?

Thanks,

DEMPC

0 Kudos
6 Replies
LucD
Leadership
Leadership

Perhaps this thread can help Re: NIC & Storage Driver Version and Firmware ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
johndavidd
Enthusiast
Enthusiast

I resorted to using plink.exe and get-content.

Thanks for the suggestion, though.

DEMPC

0 Kudos
ramkrishna1
Enthusiast
Enthusiast

Hi

Welcome to the communities.

Along with Get-Excli you need to run $ esxcli = Get-Esxcli

"concentrate the mind on the  present moment."
0 Kudos
johndavidd
Enthusiast
Enthusiast

As I stated my API version is 4.1. Get-EsxCLI is only available in 5.0 and higher.

0 Kudos
johndavidd
Enthusiast
Enthusiast

Here is the syntax:

#Specify Variables
$User = "root"
$plink = "E:\plink.exe"
$plinkoptions = " -v -pw $Pswd"

#Remote Commands
$Command1 = "vem version"
$command2 = "vmkload_mod -s enic | grep Version"
$command3 = "vmkload_mod -s fnic | grep Version"

#Run Command s
Write-Host "Run Command 1"
$VEMcommand = $plink + " " + $plinkoptions + " " + $User + "@" + $vmhost.name + " " + "`"" + $Command1 + "`""
$VEM = Invoke-Expression -command $VEMcommand  -ErrorAction SilentlyContinue
$info.VEMVersion = ($vem  | select -Index 1).split(' ')[2]
$info.VSMVersion = ($vem  | select -Index 2).split(' ')[2]
$eNICCommand = $plink + " " + $plinkoptions + " " + $User + "@" + $vmhost.name + " " + "`"" + $Command2 + "`""
$eNIC = Invoke-Expression -command $eNICCommand  -ErrorAction SilentlyContinue
$info.eNICVersion = $enic.split(',')[0].split(' ')[3]
$fNICCommand = $plink + " " + $plinkoptions + " " + $User + "@" + $vmhost.name + " " + "`"" + $Command3 + "`""
$fNIC = Invoke-Expression -command $fNICCommand  -ErrorAction SilentlyContinue
$info.fNICVersion = $fnic.split(',')[0].split(' ')[3]

0 Kudos
johndavidd
Enthusiast
Enthusiast

Using "Get-EsxCLI"

   $esxcli = Get-EsxCli -VMHost $vmhost

   $info.VEMVersion = ($esxcli.software.vib.list() | ? {$_.name -match 'vem'}).version
   $info.eNICVersion = $esxcli.system.module.get("enic").version
   $info.fNICVersion = $esxcli.system.module.get("fnic").version
0 Kudos