Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 192300

Re: How to List networking information for an ESXi host using virtual distributed switches with PowerCLI

$
0
0

Try something like this

 

$esxName="MyEsx"
$esx=Get-VMHost-Name$esxName
foreach($dvSwinGet-VDSwitch-VMHost$esx){
 
$pg=Get-VDPortgroup-VDSwitch$dvSw|%{$_.Name}
 
Get-VMHostNetworkAdapter-VMHost$esx-VMKernel|
   
where {$pg-contains$_.PortGroupName} |
   
Select@{N="dvSwitch";E={$dvSw.Name}},
     
Name,PortGroupName,IP,SubnetMask,@{N="Gateway";E={$esx.ExtensionData.Config.Network.IpRouteConfig.DefaultGateway}},
     
ManagementTrafficEnabled,VMotionEnabled
}

Viewing all articles
Browse latest Browse all 192300

Trending Articles



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