You can try if the next PowerCLI script will give you the service console IP address of an ESX 4.1 host with a distributed virtual switch. Although the script works for an ESX 3.5 host, I was not able to test it against an ESX 4.1 host because we have only ESXi 4.1. And that doesn't have a service console.
Get-View -ViewType HostSystem | ForEach-Object {
$VMHostView = $_
$NetworkSystem = Get-View $VMHostView.ConfigManager.NetworkSystem
$Report = "" | Select-Object -Property VMHost,ConsoleNicIP
$Report.VMHost = $VMHostView.Name
$Report.ConsoleNicIP = @()
$NetworkSystem.NetworkConfig.ConsoleVnic | `
Select-Object -ExpandProperty Spec | `
Select-Object -ExpandProperty IP | ForEach-Object {
$Report.ConsoleNicIP += $_.IpAddress
}
$Report
}
Regards, Robert
Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition