Oneliner: Service Console IP with PowerCLI

Getting the Service Console IP addresses of your ESX servers with vSphere PowerCLI (formerly known as the VI Toolkit for Powershell):

Get-VMHost | Select Name, @{N="ConsoleIP";E={(Get-VMHostNetwork).ConsoleNic | ForEach{$_.IP}}}

4 thoughts on “Oneliner: Service Console IP with PowerCLI

  1. Correction: You are missing the $_ after …Network
    This Works:

    Get-VMHost | Select Name, @{N=”ConsoleIP”;E={(Get-VMHostNetwork $_).ConsoleNic | ForEach{$_.IP}}}

  2. Hi All,

    I am born baby in Powershell scripting. Can any one give me a script to read all the VM`s configuration like (Mem,CPU,DISK, DISK Usage, Disk file Path and Current ESX that the VM powered on etc.) for all the VM`s in a datacenter.


Leave a Reply