Automation

 View Only
  • 1.  Ultimate ESXi Host Report

    Posted Feb 25, 2016 07:04 PM

    Hello - I am looking to find out how I can get all this information together in one report

    If I use the get-vmhost I get all the basic info I want

    Name,State,ConnectionState,PowerState,Manufacturer,Model,NumCPU,CPUTotalMhz,CPUUsage,MemTotalGB,MemUsageGB,ProcessorType,Version,Build,Parent,ApiVersion

    but how can I also get IP addresses, uptime and License Information (License Assigned)

    Any help is welcomed!

    Thanks,

    Lorri



  • 2.  RE: Ultimate ESXi Host Report

    Posted Feb 26, 2016 05:24 PM

    What version of esxi and powercli are you running?



  • 3.  RE: Ultimate ESXi Host Report

    Posted Feb 29, 2016 01:50 PM

    esxi 5.5U3 and powercli 5.1Release1

    thanks



  • 4.  RE: Ultimate ESXi Host Report

    Posted Mar 01, 2016 06:44 PM

    This will get the IP for you:

    $vmhost = "yourhost"

    Get-VMHostNetworkAdapter $vmhost | Select IP

    I'm still working on the licensing part. My lab is not cooperating at the moment.



  • 5.  RE: Ultimate ESXi Host Report

    Posted Mar 01, 2016 07:03 PM


  • 6.  RE: Ultimate ESXi Host Report

    Posted Mar 03, 2016 10:49 PM

    Try this Lorri,

    Get-Datacenter | % {   

          $datacenter=$_ 

          foreach($esx in Get-VMhost -Location $datacenter){ 

            $esxcli = Get-EsxCli -VMHost $esx 

            $nic = Get-VMHostNetworkAdapter -VMHost $esx | Select -First 1 | select -ExpandProperty Name 

            $hba =Get-VMHostHBA -VMHost $esx -Type FibreChannel | where {$_.Status -eq "online"} |  Select -First 1 |select -ExpandProperty Name 

            Get-VMHostHBA -VMHost $esx -Type FibreChannel | where {$_.Status -eq "online"} | 

            Select @{N="Datacenter";E={$datacenter.Name}}, 

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

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

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

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

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

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

                    @{N="Cluster";E={ 

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

                        else{ 

                            Get-view -Id $esx.ExtensionData.Parent | Select -ExpandProperty Name 

                        }}}, 

                    Device,Model,Status, 

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

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

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

                    @{N="Fnicvendor";E={$esxcli.hardware.pci.list() | where {$hba -contains $_.VMKernelName} |Select -ExpandProperty VendorName }}, 

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

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

                   # @{N="Enicvendor";E={$esxcli.software.vib.list() | ? {$_.Name -match ".net.*"} | Select -First 1 -Expand Vendor}} 

                     @{N="Enicvendor";E={$esxcli.hardware.pci.list() | where {$nic -contains $_.VMKernelName} |Select -ExpandProperty VendorName }} 

                     #@{N="Enicvendor";E={$esxcli.network.nic.list() | where {$vmnic.name -eq $_.vmnic1} | select -First 1 -ExpandProperty Description }} 

            } 

        } | Export-Csv -NoTypeInformation -Path C:\temp\AllInfo.CSV