PowerCLI

 View Only
Expand all | Collapse all

Get HBA firmware and driver version for all ESXi hosts

  • 1.  Get HBA firmware and driver version for all ESXi hosts

    Posted Sep 20, 2017 06:10 PM

    Hello, as you probably know the only way to find out about HBA firmware and driver versions these days is by running:

    /usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -d     to see which are the HBA devices, then

    /usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -l -i vmhba1/qlogic     to actually retrieve the needed  info for a hba. In this particular case I get this precious data below:

    value:

    QLogic PCI to Fibre Channel Host Adapter for QMH2562:

            FC Firmware version 8.02.00 (90d5), Driver version 2.1.50.0

    which I need to retrieve from all my ESXi and save to a file. I enjoy writing simple powercli scripts but I'm puzzled about this one. I know that esxcli commands can be scripted too but what about this? I could script something with plink

    $plink = plink path

    $plinkAuth = " -v -pw $Pswd"

    $remoteCommand = '/usr/lib/vmware/vmkmgmt_keyval/vmkmgmt_keyval -l -i vmhba1/qlogic'

    $command = "Echo Yes| "+$plink + " " + $plinkAuth + " " + $User + "@" + $hostName + " " + $remoteCommand

    $result = Invoke-Expression -command $command

    $result

    but as the command above throws quite some stuff I don´t know how to grab only the data output I need and save it. Obviously this is to compare with vmware compatibility matrix later. Anyone did this? I already checked Re: Host Hardware info with HBA and nic driver information but the following values are returned blank, and not sure those match the  ones above that I need. I already added  the -V2 switch to the script of that post.

    Fnicvendor   :

    fnicdriver   :

    enicdriver   :

    Enicvendor   :



  • 2.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Sep 21, 2017 06:12 PM

    Here is one to get the NIC Driver and information and may be altered to get HBA info. Give it a try.

    $Clstr = Read-host "Enter Cluster Name to get NIC Info from Hosts?"

    $Hsts = (get-cluster $Clstr | get-vmhost).Name

    Write-output " Host Name,NIC Driver,NIC Version,NIC Firmware Version" | out-file c:\temp\$Clstr.txt

    foreach ($Hst in $Hsts)

    {

        $ECli = Get-esxcli -Vmhost $Hst

        $Nics = $Ecli.network.nic.list()

        $Nics

        foreach ($Nic in $Nics)

            {

            $NicInfo = $Ecli.network.nic.get($Nic.Name).driverinfo

            $Hst + "," + $NicInfo.Driver + "," + $NicInfo.Version + "," + $NicInfo.FirmWareVersion | out-file c:\temp\$Clstr.txt -append       

            }

    }



  • 3.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Sep 22, 2017 06:46 AM

    How to modify it for the HBA driver?

    I assume that the script does not cause any impact or outage when executed.



  • 4.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Sep 22, 2017 07:53 AM

    no worries Albert, these scripts only 'read'



  • 5.  RE: Get HBA firmware and driver version for all ESXi hosts
    Best Answer

    Posted Sep 21, 2017 06:55 PM

    We have Dell hardware and this is how I got the info via PowerCLI. Replace "lpfc" with the module name you're looking for drivers from.

    # Clear the List variable

    $List = @()

    # Start Loop to run command against all hosts in the Staging Cluster

    foreach ($vmhost in ((get-cluster Cluster1)| get-vmhost))

    {

    # Pipe the Get-esxcli cmdlet into the $esxcli variable

    $esxcli = $vmhost | get-esxcli

    # I used this to gather the VMHost Name for the exported CSV file.

    $VMHostName = $vmhost.Name

    # This is the ESXCLI command I ran to get the Driver Version out of the ESXCLI System Module Get DCUI Shell.

    $List += $esxcli.system.module.get("lpfc") | Select-object @{N="VMHostName";E={$VMHostName}}, Module, Version

    }

    # Results are compiled and exported to a CSV file.

    $List | export-csv -path E:\ben\vmware\HBA_info.csv -notypeinformation



  • 6.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Sep 22, 2017 07:52 AM

    Many thanks Ben, that is what I was looking for. I replaced the driver with our qlnativefc and I got it right. I'll see to modify it to retrieve also the hba firmware version. As it is I only get the hba driver version.



  • 7.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Sep 22, 2017 04:06 PM

    Take a look at the vDocumentation scripts by Ariel Sanchez Mora and Edgar Sanchez.  It gathers a lot of info and I believe this is one of the things.. HBA Drivers & Firmware.

    https://github.com/arielsanchezmora/vDocumentation



  • 8.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Jun 12, 2018 04:03 AM

    BenLiebowitz​,

    Thanks for sharing the script, however, it is not working:

    Message: Cannot access module instance.;

    InnerText: Cannot access module instance.EsxCLI.CLIFault.summary

    +     $List += $esxcli.system.module.get("lpfc") | Select-object @{N="V ...

    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : OperationStopped: (:) [], ViError

        + FullyQualifiedErrorId : VMware.VimAutomation.Sdk.Types.V1.ErrorHandling.VimException.ViError

    Does it means I do not have LPFC components ?



  • 9.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Jun 13, 2018 01:04 PM

    The script I wrote is for HP hardware.  If you don't have the LPFC card, then yes, the script would fail. 



  • 10.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Aug 01, 2018 03:54 PM

    Does this script pull just the driver version or the HBA firmware as well? I see that you mentioned in your first comment that it pulls the driver version, but I do not see any mention of the HBA firmware. Can you please clarify?



  • 11.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Nov 28, 2018 09:55 AM

    It is not solved. It only shows driver. Not firmware. Same goes for vDocumentation (though it's a really nice script).

    Hostname         : *

    Version          : ESXi 6.0 U3

    Slot Description : Mezzanine Slot 1

    VMKernel Name    : vmhba0

    Device Name      : Emulex LPe16000 16Gb PCIe Fibre Channel Adapter

    Vendor Name      : Emulex Corporation

    Device Class     : Fibre Channel

    PCI Address      : 0000:09:00.0

    VID              : 10df

    DID              : e200

    SVID             : 103c

    SSID             : 1956

    VIB Name         : lpfc

    Driver           : lpfc

    Driver Version   : 11.2.266.0-1OEM.600.0.0.2768847

    Firmware Version : 

    HCL URL          : https://www.vmware.com/resources/compatibility/search.php?deviceCategory=io&VID=10df&DID=e200&SVID=103c&SSID=1956&details=1

    ProductId        : 39877

    Hostname         : bma-bc03-esx13.ble.local
    Version          : ESXi 6.0 U3
    Slot Description : Mezzanine Slot 1
    VMKernel Name    : vmhba0
    Device Name      : Emulex LPe16000 16Gb PCIe Fibre Channel Adapter
    Vendor Name      : Emulex Corporation
    Device Class     : Fibre Channel
    PCI Address      : 0000:09:00.0
    VID              : 10df
    DID              : e200
    SVID             : 103c
    SSID             : 1956
    VIB Name         : lpfc
    Driver           : lpfc
    Driver Version   : 11.2.266.0-1OEM.600.0.0.2768847
    Firmware Version : 
    ProductId        : 39877


  • 12.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Jan 09, 2019 02:25 PM

    You can get these information much easier! Try "esxcli storage san fc list" in a ssh session.

    Sample Output:

       Adapter: vmhba2

       Port ID: 7A4800

       Node Name: 20:00:00:10:9b:4f:xx:xx

       Port Name: 10:00:00:10:9b:4f:xx:xx

       Speed: 16 Gbps

       Port Type: NPort

       Port State: ONLINE

       Model Description: Emulex LightPulse LPe31000-M6 1-Port 16Gb Fibre Channel Adapter

       Hardware Version: 0000000c

       OptionROM Version: 11.2.210.13

       Firmware Version: 11.2.210.13

       Driver Name: lpfc

       DriverVersion: 11.4.33.1



  • 13.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Aug 21, 2020 09:24 AM

    $ESXHost = get-vmhost "myhost"

    $esxcli = Get-EsxCli -vmhost $ESXHost

    $esxcli.storage.san.fc.list()



  • 14.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Sep 11, 2020 05:53 PM

    Hi,

    I found this script on one of the online forums, but first you have to have PowerCli 6.5 or later.

    1- Start PowerCli.

    2- Connect to your vCenter using Connect-VIServer command.

    3- Copy the below script to a notepad file and then rename it to .ps1

    4- From the PowerCli shell, go to the destination of your ps1 script and then execute.

     

    This script has exported HBA and VNICs firmware and driver versions info for all of my HPE ESXI hosts.

    If you want specific cluster or specific host, change the first line of the script with one of the following;

    Example:
    $vmhosts = Get-VMHost fqdn-of-your-esxihost - Check a single Host
    $vmhosts = Get-Cluster you-cluster-name | Get-VMHost - Checks all hosts in a cluster
    $vmhosts = Get-VMHost - Checks all hosts in the vCenter

     

     

    Script is below:

     

    ################################################

    $vmhosts = Get-VMHost

     

    $report = @()

     

    foreach ($ESXHost in $vmhosts) {

     

        $esxcli = Get-EsxCli -vmhost $ESXHost

     

        $nicfirmware = $esxcli.network.nic.list()

     

        $fcfirmware = $esxcli.storage.san.fc.list()

     

        $driversoft = $esxcli.software.vib.list()

     

            foreach($nicfirmwareselect in $nicfirmware)

     

                {

     

                    $NetworDescription = $nicfirmwareselect.Description

     

                    $NetworDriver = $driversoft | where { $_.name -eq ($nicfirmwareselect.Driver) }

     

                    $NetworkName = $nicfirmwareselect.Name

     

                    $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)).DriverInfo.FirmwareVersion

     

     

     

                    $report += "" |

     

                    select @{N = "Hostname"; E = { $ESXHost.Name } },

     

                    @{N = "Hardware-Model"; E = { $ESXHost.Model } },

     

                    @{N = "device"; E = { $NetworkName } },

     

                    @{N = "driver"; E = { $NetworDriver.Version } },

     

                    @{N = "firmware"; E = { $NetworkFirmware } },

     

                    @{N = "description"; E = { $NetworDescription } }

     

                }

     

            foreach($fcfirmwareselect in $fcfirmware)

     

                {

     

                    $fcDescription = $fcfirmwareselect.ModelDescription

     

                    $fcDriver = $driversoft | where { $_.name -eq ($fcfirmwareselect.DriverName) }

     

                    $fcName = $fcfirmwareselect.Adapter

     

                    $fcFirmware = $fcfirmwareselect.FirmwareVersion

     

     

     

                    $report += "" |

     

                    select @{N = "Hostname"; E = { $ESXHost.Name } },

     

                    @{N = "Hardware-Model"; E = { $ESXHost.Model } },

     

                    @{N = "device"; E = { $fcName } },

     

                    @{N = "driver"; E = { $fcDriver.Version } },

     

                    @{N = "firmware"; E = { $fcFirmware } },

     

                    @{N = "description"; E = { $fcDescription } }

     

                }

     

    }

     

    $report | Export-Csv -Path 'C:\ESXI HBA & NIC info.csv'

    ########################################################################
     
     
     
     
    $vmhosts = Get-VMHost
     
    $report = @()
     
    foreach ($ESXHost in $vmhosts) {
     
        $esxcli = Get-EsxCli -vmhost $ESXHost
     
        $nicfirmware = $esxcli.network.nic.list()
     
        $fcfirmware = $esxcli.storage.san.fc.list()
     
        $driversoft = $esxcli.software.vib.list()
     
            foreach($nicfirmwareselect in $nicfirmware)
     
                {
     
                    $NetworDescription = $nicfirmwareselect.Description
     
                    $NetworDriver = $driversoft | where { $_.name -eq ($nicfirmwareselect.Driver) }
     
                    $NetworkName = $nicfirmwareselect.Name
     
                    $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)).DriverInfo.FirmwareVersion
     
     
     
                    $report += "" |
     
                    select @{N = "Hostname"; E = { $ESXHost.Name } },
     
                    @{N = "Hardware-Model"; E = { $ESXHost.Model } },
     
                    @{N = "device"; E = { $NetworkName } },
     
                    @{N = "driver"; E = { $NetworDriver.Version } },
     
                    @{N = "firmware"; E = { $NetworkFirmware } },
     
                    @{N = "description"; E = { $NetworDescription } }
     
                }
     
            foreach($fcfirmwareselect in $fcfirmware)
     
                {
     
                    $fcDescription = $fcfirmwareselect.ModelDescription
     
                    $fcDriver = $driversoft | where { $_.name -eq ($fcfirmwareselect.DriverName) }
     
                    $fcName = $fcfirmwareselect.Adapter
     
                    $fcFirmware = $fcfirmwareselect.FirmwareVersion
     
     
     
                    $report += "" |
     
                    select @{N = "Hostname"; E = { $ESXHost.Name } },
     
                    @{N = "Hardware-Model"; E = { $ESXHost.Model } },
     
                    @{N = "device"; E = { $fcName } },
     
                    @{N = "driver"; E = { $fcDriver.Version } },
     
                    @{N = "firmware"; E = { $fcFirmware } },
     
                    @{N = "description"; E = { $fcDescription } }
     
                }
     
    }
     
     
     
    $report | Export-Csv -Path 'C:\Users\505000367110\Desktop\hba-info.csv'


  • 15.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Mar 23, 2021 02:00 PM

    Is it possible to  add a few more information's to the script?

    I would also need Vendor ID (VID), Device ID (DID), Sub-Vendor ID (SVID), and Sub-Device ID (SDID) for nic and hba.

    If you connect to esx host via putty and run this command "mkchdev -l |grep vmnic", the result for nic would be

    002:01.0 8086:100f 15ad:0750 vmkernel vmnic0

    In this example, the values are:

    VID = 8086
    DID = 100f
    SVID = 15ad
    SDID = 0750

    same command for hba

    vmkchdev -l |grep vmhba

     

    Can this be added to the script?

     



  • 16.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Mar 23, 2021 02:38 PM


  • 17.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 08, 2021 03:46 PM

    , I'm getting below errors while fetching HBA /NIC firmware and driver version details. any suggestion would be really appreciated.

     
    Script###### Start#################
    vmhosts1 = Get-Content -Path "C:\Temp\HostList1.txt"


    $report = @()

    foreach ($ESXHost in $vmhosts1) {

    $esxcli = Get-EsxCli -VMHost $ESXHost -V2

    $nicfirmware = $esxcli.network.nic.list()

    $fcfirmware = $esxcli.storage.san.fc.list()

    $driversoft = $esxcli.software.vib.list()

    foreach($nicfirmwareselect in $nicfirmware)



    {



    $NetworDescription = $nicfirmwareselect.Description



    $NetworDriver = $driversoft | where { $_.name -eq ($nicfirmwareselect.Driver) }



    $NetworkName = $nicfirmwareselect.Name



    $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)).DriverInfo.FirmwareVersion


    $report += "" | select @{N = "Hostname"; E = { $ESXHost.Name } },



    @{N = "Hardware-Model"; E = { $ESXHost.Model } },



    @{N = "device"; E = { $NetworkName } },



    @{N = "driver"; E = { $NetworDriver.Version } },



    @{N = "firmware"; E = { $NetworkFirmware } },



    @{N = "description"; E = { $NetworDescription } }



    }



    foreach($fcfirmwareselect in $fcfirmware)



    {



    $fcDescription = $fcfirmwareselect.ModelDescription



    $fcDriver = $driversoft | where { $_.name -eq ($fcfirmwareselect.DriverName) }



    $fcName = $fcfirmwareselect.Adapter



    $fcFirmware = $fcfirmwareselect.FirmwareVersion







    $report += "" |



    select @{N = "Hostname"; E = { $ESXHost.Name } },



    @{N = "Hardware-Model"; E = { $ESXHost.Model } },



    @{N = "device"; E = { $fcName } },



    @{N = "driver"; E = { $fcDriver.Version } },



    @{N = "firmware"; E = { $fcFirmware } },



    @{N = "description"; E = { $fcDescription } }



    }



    }

    $report
     
    Script###### End#################

     

     

    Runtime Error:  no list method

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'list'.
    At line:18 char:1
    + $nicfirmware = $esxcli.network.nic.list()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (list:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'list'.
    At line:22 char:1
    + $fcfirmware = $esxcli.storage.san.fc.list()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (list:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

     

    Regards,

    Naveen



  • 18.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 08, 2021 03:52 PM

    When you use the V2 switch on Get-EsxCli you have to use the Invoke() method.

    $esxcli.software.vib.list.Invoke()


  • 19.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 08, 2021 03:56 PM

     Thanks so much for the quick response. Actually i had tried with both options but no luck still the same issue.

     

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'list'.
    At line:22 char:1
    + $fcfirmware = $esxcli.storage.san.fc.list()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (list:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Object of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.



  • 20.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 08, 2021 03:59 PM

     I'm getting below error now.

    bject of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.
    At line:22 char:1
    + $fcfirmware = $esxcli.storage.san.fc.list.Invoke()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

    Object of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.
    At line:26 char:1
    + $driversoft = $esxcli.software.vib.list.Invoke()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'get'.
    At line:50 char:1
    + $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)) ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (get:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound



  • 21.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 08, 2021 04:02 PM

    Try changing the start of the script to

    $vmhosts1 = Get-Content -Path "C:\Temp\HostList1.txt"
    
    
    $report = @()
    
    foreach ($ESXHost in (Get-VMHost -Name $vmhosts1)) {


  • 22.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 12, 2021 07:01 AM

     My Apologies for the delay. I had fever due to which couldn't login last few days. I've changed the script as per your suggestion. However, there is no luck and still getting same error. Kindly advise.

     

    ======script Start================

    $vmhosts1 = Get-Content -Path "C:\Temp\HostList1.txt"

    $report = @()

    foreach ($ESXHost in (Get-VMHost -Name $vmhosts1)) {

     

    $esxcli = Get-EsxCli -VMHost $ESXHost -V2

     

    $nicfirmware = $esxcli.network.nic.list.Invoke()

     

    $fcfirmware = $esxcli.storage.san.fc.list.Invoke()

     

    $driversoft = $esxcli.software.vib.list.Invoke()

     

    foreach($nicfirmwareselect in $nicfirmware)

     

    {

     

    $NetworDescription = $nicfirmwareselect.Description

     

    $NetworDriver = $driversoft | where { $_.name -eq ($nicfirmwareselect.Driver) }

     

    $NetworkName = $nicfirmwareselect.Name

     

    $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)).DriverInfo.FirmwareVersion

     

     

     

    $report += "" |

     

    select @{N = "Hostname"; E = { $ESXHost.Name } },

     

    @{N = "Hardware-Model"; E = { $ESXHost.Model } },

     

    @{N = "device"; E = { $NetworkName } },

     

    @{N = "driver"; E = { $NetworDriver.Version } },

     

    @{N = "firmware"; E = { $NetworkFirmware } },

     

    @{N = "description"; E = { $NetworDescription } }

     

    }

     

    foreach($fcfirmwareselect in $fcfirmware)

     

    {

     

    $fcDescription = $fcfirmwareselect.ModelDescription

     

    $fcDriver = $driversoft | where { $_.name -eq ($fcfirmwareselect.DriverName) }

     

    $fcName = $fcfirmwareselect.Adapter

     

    $fcFirmware = $fcfirmwareselect.FirmwareVersion

     

     

     

    $report += "" |

     

    select @{N = "Hostname"; E = { $ESXHost.Name } },

     

    @{N = "Hardware-Model"; E = { $ESXHost.Model } },

     

    @{N = "device"; E = { $fcName } },

     

    @{N = "driver"; E = { $fcDriver.Version } },

     

    @{N = "firmware"; E = { $fcFirmware } },

     

    @{N = "description"; E = { $fcDescription } }

     

    }

     

    }

     

    $report | Export-Csv -Path "C:\Temp\ESXI HBA & NIC info.csv" -NoClobber -NoTypeInformation

    ========Script End============

     

    Error details:

    ===========

    Object of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.
    At line:22 char:1
    + $fcfirmware = $esxcli.storage.san.fc.list.Invoke()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

    Object of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.
    At line:26 char:1
    + $driversoft = $esxcli.software.vib.list.Invoke()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'get'.
    At line:50 char:1
    + $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)) ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (get:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'get'.
    At line:50 char:1
    + $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)) ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (get:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'get'.
    At line:50 char:1
    + $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)) ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (get:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'get'.
    At line:50 char:1
    + $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)) ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (get:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

    Method invocation failed because [VMware.VimAutomation.ViCore.Impl.V1.EsxCli.EsxCliElementImpl] does not contain a method named 'get'.
    At line:50 char:1
    + $NetworkFirmware = ($esxcli.network.nic.get($nicfirmwareselect.Name)) ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (get:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

     

    Regards,

    Naveen



  • 23.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 12, 2021 08:29 AM

    Works for me.
    What do you have in that .TXT file?
    The name of 1 ESXi node per line, no column headers?

    Btw, the line $esxcli.network.nic.get($nicfirmwareselect.Name) is wrong when using the V2 switch on Get-EsxCli.



  • 24.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 13, 2021 03:35 PM

     Please find required details below.

     

    What do you have in that .TXT file? List of host names with FQDN
    The name of 1 ESXi node per line, no column headers? Yep.

     

     

    Regards,

    Naveen



  • 25.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 13, 2021 04:03 PM

    Not a lot I can further deduce from that error.
    I would suggest you add some Write-Host lines to see what is each variable.
    Starting with the $esxHost and $esxcli variable



  • 26.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 14, 2021 05:45 AM

     Here are variables output. also, I'm getting permission denied message. What all the permissions needed to use below cmdlet and to call below methods.

    Get-EsxCli

    $esxcli.network.nic.list.Invoke()

    $esxcli.storage.san.fc.list.Invoke()

    $esxcli.software.vib.list.Invoke()

     

    swamynaveen_0-1618378954797.png

    Regards,

    Naveen



  • 27.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 14, 2021 06:52 AM

    Like I said earlier, there is not a lot I can do remotely.
    It looks odd that you now all of a sudden have a permission error.
    You will have to debug this yourself, since it seems to be something specific to your environment.



  • 28.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 14, 2021 01:33 PM

     finally I was able to fetch the HBA firmware/Driver version details after connecting to vsphere.local super user. I just want to know which permissions are required to be able to execute below methods using ADS user. Kindly advise.

    $nicfirmware = $esxcli.network.nic.list.Invoke()

     

    $fcfirmware = $esxcli.storage.san.fc.list.Invoke()

     

    $driversoft = $esxcli.software.vib.list.Invoke()

    HostnameHardware-Modeldevicedriver VersiondriverFirmware Versiondescription
    HostName1ProLiant BL460c Gen9vmhba012.0.1211.0-1OEM.670.0.0.8169922brcmfcoe11.4.1231.6HP FlexFabric 20Gb 2-port 650FLB Adapter
    HostName1ProLiant BL460c Gen9vmhba112.0.1211.0-1OEM.670.0.0.8169922brcmfcoe11.4.1231.6HP FlexFabric 20Gb 2-port 650FLB Adapter
    HostName3ProLiant BL460c Gen9vmhba012.0.1211.0-1OEM.670.0.0.8169922brcmfcoe11.4.1231.6HP FlexFabric 20Gb 2-port 650FLB Adapter
    HostName3ProLiant BL460c Gen9vmhba112.0.1211.0-1OEM.670.0.0.8169922brcmfcoe11.4.1231.6HP FlexFabric 20Gb 2-port 650FLB Adapter
    HostName2ProLiant BL460c Gen9vmhba012.0.1211.0-1OEM.670.0.0.8169922brcmfcoe11.4.1231.6HP FlexFabric 20Gb 2-port 650FLB Adapter
    HostName2ProLiant BL460c Gen9vmhba112.0.1211.0-1OEM.670.0.0.8169922brcmfcoe11.4.1231.6HP FlexFabric 20Gb 2-port 650FLB Adapter

    Regards,

    Naveen



  • 29.  RE: Get HBA firmware and driver version for all ESXi hosts

    Posted Apr 14, 2021 01:40 PM

    No clue