I have the following PowerShell script which queries the VMkernels on all VMware hosts in one vCenter and exports the following details:
VMHost,Name,PortGroupName,Mac,IP,SubnetMask, ManagementTrafficEnabled, VMotionEnabled
The script:
Get-VMHostNetworkAdapter -VMKernel -VMHost (get-cluster * | get-vmhost) | Select VMHost,Name,PortGroupName,Mac,IP,SubnetMask, ManagementTrafficEnabled, VMotionEnabled | Sort-Object -Property VMHost, Name
I would also like to get the cluster name from which each host is attached to, so I was wondering, can I get these details from this script or do I have to add more to it?
Here’s everything I can get from this script:
VMotionEnabled : False
FaultToleranceLoggingEnabled : False
ManagementTrafficEnabled : False
IPv6 :
AutomaticIPv6 :
IPv6ThroughDhcp :
IPv6Enabled :
Mtu : 9000
VsanTrafficEnabled : False
PortGroupName : vxw-vmknicPg-dvs-005-1022-7ab0e0cc-6ca1-43ab-976e-abababababab
Id : key-vim.host.VirtualNic-vmk5
VMHostId : HostSystem-host-44587
VMHost : MyHost.MyDomain
VMHostUid : /VIServer=domain\user@vcenter:443/VMHost=HostSystem-host-44587/
DeviceName : vmk5
Mac : 00:50:56:00:00:00
DhcpEnabled : False
IP : 192.20.0.8
SubnetMask : 255.255.0.0
Uid : /VIServer=domain\user@vcenter:443/VMHost=HostSystem-host-44587/HostVMKernelVirtualNic=key-vim.host.VirtualNic-vmk5/
Name : vmk5
ExtensionData : VMware.Vim.HostVirtualNic