Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 215516

Re: Host Hardware info with HBA and nic driver information

$
0
0

Try like this

 

Get-Datacenter|% {  

      $datacenter=$_

      foreach($esxinGet-VMhost-Location$datacenter){

        $esxcli=Get-EsxCli-VMHost$esx

        $hba=Get-VMHostHBA-VMHost$esx-TypeFibreChannel|where {$_.Status -eq"online"} |  Select-First1

        $nic=Get-VMHostNetworkAdapter-VMHost$esx|Select-First1

        $esx|Select @{N="Datacenter";E={$datacenter}},

                @{N="VMHost";E={$esx.Name}},

                @{N="HostName";E={$($hba.VMHost |Get-VMHostNetwork).HostName}},

                @{N="ver";E={$esx.version}},

                @{N="Manf";E={$esx.Manufacturer}},

                @{N="Hostmodel";E={$esx.Model}},

                @{Name="SerialNumber";Expression={$esx.ExtensionData.Hardware.SystemInfo.OtherIdentifyingInfo |Where-Object {$_.IdentifierType.Key -eq"Servicetag"} |Select-Object-ExpandPropertyIdentifierValue}},

                @{N="Cluster";E={

                    if($esx.ExtensionData.Parent.Type -ne"ClusterComputeResource"){"Stand alone host"}

                    else{

                        Get-view-Id$esx.ExtensionData.Parent |Select-ExpandPropertyName

                    }}},

                @{N="HBA Device";E={$hba.Device}},

                @{N="HBA Model";E={$hba.Model}},

                @{N="HBA Status";E={$hba.Status}},

                @{N="WWN";E={((("{0:X}"-f$hba.PortWorldWideName).ToLower()) -replace"(\w{2})",'$1:').TrimEnd(':')}},

                @{N="fnicdriver";E={$esxcli.software.vib.list() |? {$_.Name -match".*$($hba.hbadriver).*"} |Select-First1-ExpandVersion}},

                @{N="Fnicvendor";E={$esxcli.software.vib.list() |? {$_.Name -match".*$($hba.hbadriver).*"} |Select-First1-ExpandVendor}},

                @{N="enicdriver";E={$esxcli.system.module.get("enic").version}},

                @{N="Enicvendor";E={$esxcli.software.vib.list() |? {$_.Name -match".net.*"} |Select-First1-ExpandVendor}}

        }

    }  

 


Viewing all articles
Browse latest Browse all 215516

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>