June 20, 2018

Export Esxi Host list with there IPs in a Data Center

This Command will help you to Export list of Esxi servers in a Data Center with there management IPs .

First connect to the Data Center , and execute below command.

Get-VMHost  | Select Name,@{N="IP Address";E={($_.ExtensionData.Config.Network.Vnic | ? {$_.Device -eq "vmk0"}).Spec.Ip.IpAddress}} | export-csv -NoTypeInformation .\file.csv

No comments:

Post a Comment