VMware Cloud Community
MihirP
Enthusiast
Enthusiast
Jump to solution

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

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
Anjani_Kumar
Commander
Commander
Jump to solution

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

Reply
0 Kudos
9 Replies
Anjani_Kumar
Commander
Commander
Jump to solution

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
Reply
0 Kudos
MihirP
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
MihirP
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
vin01
Expert
Expert
Jump to solution

‌Try this variation..

Host Hardware info with HBA and nic driver information

Regards Vineeth.K
Reply
0 Kudos
MihirP
Enthusiast
Enthusiast
Jump to solution

Giving me error;

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

Reply
0 Kudos
MihirP
Enthusiast
Enthusiast
Jump to solution

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.


Reply
0 Kudos
MihirP
Enthusiast
Enthusiast
Jump to solution

No one to help me?

Reply
0 Kudos
touimet
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos