1 2 3 Previous Next 36 Replies Latest reply on Mar 22, 2019 10:31 PM by LucD Go to original post
      • 30. Re: PowerCLI Report :Getting inventory VMs from ESX cluster hosts
        LucD Guru
        Community WarriorsUser ModeratorsvExpert

        A wild guess, can you try the following script in both environments?

         

        Get-VM |

        Select Name,

            @{N='IP1';E={$_.ExtensionData.Guest.IPAddress -join '|'}},

            @{N='IP2';E={$_.ExtensionData.Guest.Net.IpAddress -join '|'}},

            @{N='IP3';E={($_.ExtensionData.Guest.Net | %{$_.IPAddress}) -join '|'}}

         

        Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
        • 31. Re: PowerCLI Report :Getting inventory VMs from ESX cluster hosts
          arbelac Novice

          VMware vSphere PowerCLI 5.5 R2

          esx.PNG

           

          VMware vSphere PowerCLI 6.3


          esx1.PNG

          • 32. Re: PowerCLI Report :Getting inventory VMs from ESX cluster hosts
            LucD Guru
            Community WarriorsvExpertUser Moderators

            I just noticed this.

            Are these environments pre-5.0?

            ipaddress.png

            Can you run this one as well in both environments?

             

            Get-VM |

            Select Name,

                @{N='IP1';E={$_.ExtensionData.Guest.IPAddress -join '|'}},

                @{N='IP2';E={$_.ExtensionData.Guest.Net.IpAddress -join '|'}},

                @{N='IP3';E={($_.ExtensionData.Guest.Net | %{$_.IPConfig | %{$_.IPAddress | %{$_.IPAddress}}}) -join '|'}}

            Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
            • 33. Re: PowerCLI Report :Getting inventory VMs from ESX cluster hosts
              arbelac Novice

              No luck I am getting same results. I can continue with VMware PowercLI 5.5 Also  I want to add script which reports on any datastores over 90% utilisation I have got script like below. How can I adapted my script ?

               

               

              foreach ($datastore in (get-datastore | where {$_.name -notlike "*local*" -and [math]::Round(100-($_.freespacegb/$_.capacitygb)*100) -gt 90}))
              {
              $row = '' | select Name,FreeSpaceGB,CapacityGB,vCenter,PercentUsed
              $row.Name = $datastore.name
              $row.FreeSpaceGB = $datastore.freespacegb
              $row.CapacityGB = $datastore.capacitygb
              $row.vCenter = $vcenter.name
              $row.PercentUsed = [math]::Round(100-($datastore.freespacegb/$datastore.capacitygb)*100)
              $report += $row
              • 34. Re: PowerCLI Report :Getting inventory VMs from ESX cluster hosts
                LucD Guru
                Community WarriorsUser ModeratorsvExpert

                I would suggest you create a new thread for that last question.
                This thread is already way beyond the thread's title.

                Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                • 35. Re: PowerCLI Report :Getting inventory VMs from ESX cluster hosts
                  RJ4719 Novice

                  LucD not sure what I'm doing wrong here with this code, each time I run it seems it does the data fetching however when it tries to build the report it starts spitting out errors.

                   

                   

                  Get-View : Cannot validate argument on parameter 'Id'. The argument is null, empty, or an element of the argument collection contains a null value. Supply a

                  collection that does not contain any null values and then try the command again.At

                  C:\Users\Edward\Documents\WindowsPowerShell\Scripts\VM_InventoryLucD2.ps1:41 char:27

                  +             $t = Get-View $t.Parent -Property Name,Parent -Server $vc

                  +                           ~~~~~~~~~

                      + CategoryInfo          : InvalidData: (:) [Get-View], ParameterBindingValidationException

                      + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

                   

                   

                  Line 41 of code is:            $t = Get-View $t.Parent -Property Name,Parent -Server $vc

                   

                   

                   

                  Only change I made to the code was the path to the output.

                  • 36. Re: PowerCLI Report :Getting inventory VMs from ESX cluster hosts
                    LucD Guru
                    vExpertUser ModeratorsCommunity Warriors

                    Can you attach the code you are running?
                    There are a few variations on the script in this thread.

                    Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                    1 2 3 Previous Next