Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 193198

Array of all IP address in vCenter

$
0
0

I am trying to populate a list of all VMs with VMTools and IP information and am exporting it to CSV

 

I have got some VMs which have multiple IPs so I wanted to list all the IPs in the respective IP column

 

For eg:-

 

Guest          IP          VMTools Version

~~~~~     ~~~~~     ~~~~~~~~~~~~~~

VM1        10.1.1.1      8290

VM2        10.1.2.1      7302

               10.1.2.3

               10.1.2.5

VM3        10.4.1.5      8295

.

.

.

.

etc.

 

I m using something like this -

 

Foreach ($Guests in (Get-VM -name (Get-Content $VMList))) {
     $VM = Get-VM $Guests
     $row = New-Object System.Object
     $row | Add-Member -Type NoteProperty -Name "Guest" -Value $Guests
     $row | Add-Member -Type NoteProperty -Name "IP" -Value $VM.Guest.IPAddress | %{[String]::Join(',',$_.IPAddress)}
     $row | Add-Member -Type NoteProperty -Name "VMTools Version" -Value $VM.ExtensionData.Guest.ToolsVersion
     $row
     $stats += $row
}

 

 

 

But in the final output, it shows as "System.String[]"

Please Help!!!


Viewing all articles
Browse latest Browse all 193198

Trending Articles



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