Highlighted
Enthusiast
Enthusiast

Powershell for getting ESXi info, NIC driver and firmware, HBA driver and firmware

Jump to solution

Hello,

Can anyone please provide me Powershell or PowerCLI script that can list;

1) ESXi info

2) NIC driver and firmware

3) HBA driver and firmware

into Excel sheet?

I do not mind if there are 3 separate scripts.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Commander
Commander

NIC and Firmware update can be found by this Script : VMware Powercli – Gather NIC Driver and Firmware Versions from Hosts via vCenter | Cit3.net

This thread will work out pefectly for you ESXi 5.0 U1 HBA Details: Power CLI

Please consider marking this answer "correct" or "helpful" if you found it useful. Anjani Kumar | VMware vExpert 2014-2015-2016 | Infrastructure Specialist Twitter : @anjaniyadav85 Website : http://www.Vmwareminds.com

View solution in original post

0 Kudos
9 Replies
Highlighted
Commander
Commander

NIC and Firmware update can be found by this Script : VMware Powercli – Gather NIC Driver and Firmware Versions from Hosts via vCenter | Cit3.net

This thread will work out pefectly for you ESXi 5.0 U1 HBA Details: Power CLI

Please consider marking this answer "correct" or "helpful" if you found it useful. Anjani Kumar | VMware vExpert 2014-2015-2016 | Infrastructure Specialist Twitter : @anjaniyadav85 Website : http://www.Vmwareminds.com

View solution in original post

0 Kudos
Highlighted
Enthusiast
Enthusiast

Thanks, but I do not see any option where it would export results to CSV.

Please not that I am not a scripting guy Smiley Happy

Thanks.

0 Kudos
Highlighted
Highlighted
Enthusiast
Enthusiast

Thanks. For HBA info, the script uses PLINK "$plink = "D:\plink.exe"

What is that and how to get it?

NIC info script lists results in one column only.

I need the out put in csv per column.


Host NameVMNic_NameDriver NameDriver VersionFirmware Version

Thanks.

0 Kudos
Highlighted
Expert
Expert

‌Try this variation..

Host Hardware info with HBA and nic driver information

Regards Vineeth.K
0 Kudos
Highlighted
Enthusiast
Enthusiast

Giving me error;

"the term 'Get-Datacenter' is not recognized as the name of a cmdlet........'

0 Kudos
Highlighted
Enthusiast
Enthusiast

Never mind, I did not connect to vCenter. Connected and script worked.

1) For HBA script

Can anyone please modify below script to include "Vendor" (i.e. HBA make) and "Device" (i.e. vmhba1 or vmhba2 etc" in the output?

ESXi 5.0 U1 HBA Details: Power CLI

2) For NIC


Can anyone please modify the script to include

-- Network Adapter model

-- vmkchdev


VMware Powercli – Gather NIC Driver and Firmware Versions from Hosts via vCenter | Cit3.net


Thanks.


0 Kudos
Highlighted
Enthusiast
Enthusiast

No one to help me?

0 Kudos
Highlighted
Enthusiast
Enthusiast

MihirP,

The code in bold is what you will add to the script.  The code above and below in italics is there to give you reference as to where to add the additional code.

$objOneNic = New-Object System.Object     ####   <<<<<<  Existing code

############   Add this code here  ############

$nicPCIinfo = $esxcli.hardware.pci.list() | where {$_.VMkernelName -eq $VMNic.Name}

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

$objDriverInfo = ($esxcli.network.nic.get($VMNic.Name)).DriverInfo    ####   <<<<<<  Existing code

$objOneNic | Add-Member -type NoteProperty -name FirmwareVersion -Value $objDriverInfo.FirmwareVersion   ####   <<<<<<  Existing code

############   Add this code here  ############

$objOneNic | Add-Member -type NoteProperty -name VendorID -Value ( "{0:x}" -f [int]$nicPCIinfo.VendorID ) # Must convert from dec to hex

$objOneNic | Add-Member -type NoteProperty -name DeviceID -Value ( "{0:x}" -f [int]$nicPCIinfo.DeviceID ) # Must convert from dec to hex

$objOneNic | Add-Member -type NoteProperty -name SubVendorID -Value ( "{0:x}" -f [int]$nicPCIinfo.SubVendorID ) # Must convert from dec to hex

$objOneNic | Add-Member -type NoteProperty -name SubDeviceID -Value ( "{0:x}" -f [int]$nicPCIinfo.SubDeviceID ) # Must convert from dec to hex

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

$arrNicDetail += $objOneNic   ####   <<<<<<  Existing code

0 Kudos