VMware Cloud Community
MihirP
Enthusiast
Enthusiast

Modify Powershell script to NIC and HBA info

Hello,

1) For HBA script ->

Can anyone please modify below script to include

-- Vendor (i.e. HBA make, QLOGIC etc)

-- Device (i.e. vmhba1 or vmhba2)

ESXi 5.0 U1 HBA Details: Power CLIESXi 5.0 U1 HBA Details: Power CLI

2) For NIC


Can anyone please modify below script to include

-- Network Adapter model

-- vmkchdev (which will list VID, SSID etc)


http://www.cit3.net/vmware-powercli-gather-nic-driver-and-firmware-versions-from-hosts-via-vcenter/VMware Powercli – Gather NIC Driver and Firmware Versions from Hosts via vCenter | Cit3.net


Thanks.


Reply
0 Kudos
3 Replies
MihirP
Enthusiast
Enthusiast

Awaiting reply from someone please.

Thanks.

Reply
0 Kudos
MihirP
Enthusiast
Enthusiast

Awaiting reply from someone please. Thanks

Reply
0 Kudos
touimet
Enthusiast
Enthusiast

The code in black is what you will add to the code.  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