vSphere PowerCLI Reference

Get-VMHostNetworkAdapter

Synopsis

This cmdlet retrieves the host network adapters on a vCenter Server system.

Syntax

Get-VMHostNetworkAdapter [-VMHost <VMHost[]>] [[-VirtualSwitch] <VirtualSwitchBase[]>] [-PortGroup <VirtualPortGroupBase[]>] [-Physical] [-VMKernel] [-Console] [[-Name] <String[]>] [-Id <String[]>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
New-VMHostNetworkAdapter
Remove-VMHostNetworkAdapter
Set-VMHostNetworkAdapter

Detailed Description

This cmdlet retrieves the host network adapters on a vCenter Server system.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VirtualSwitchVirtualSwitchBase[]Specifies the virtual switches to which network adapters that you want to retrieve are connected. The position of this parameter is deprecated and will be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions, specify the parameter by name.falsetrue (ByValue)
NameString[]Specifies the names of the host network adapters you want to retrieve. The position of this parameter is deprecated and will be changed in a future release. To avoid errors when you run existing scripts on future PowerCLI versions, specify the parameter by name.falsefalse
ConsoleSwitchParameterIndicates that you want to retrieve only service console virtual network adapters.falsefalse
IdString[]Specifies the IDs of the host network adapters you want to retrieve.falsefalse
PhysicalSwitchParameterIndicates that you want to retrieve only physical network adapters.falsefalse
PortGroupVirtualPortGroupBase[]Specifies the port groups to which network adapters that you want to retrieve are connected.falsetrue (ByValue)
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
VMHostVMHost[]Specifies the hosts whose network adapters you want to retrieve. The position of this parameter is deprecated and might change in a following release.falsetrue (ByValue)
VMKernelSwitchParameterIndicates that you want to retrieve only VMKernel virtual network adapters.falsefalse

Return Type

Zero or more HostVirtualNic objects

Notes

Examples

-------------- Example 1 --------------

Get-VMHostNetworkAdapter -VMKernel

Retrieves information about about all VMKernel network adapters on servers that you are connected to.

-------------- Example 2 --------------

$myVMHost = Get-VMHost -Name MyVMHost
Get-VMHostNetworkAdapter -VMHost $myVMHost -Physical

Retrieves all physical network adapters on the specified host.

-------------- Example 3 --------------

$myVDSwitch = Get-VDSwitch -Name MyVDSwitch
Get-VMHostNetworkAdapter -VirtualSwitch $myVDSwitch -VMKernel

Retrieves all VMKernel network adapters connected to the specified virtual switch.

-------------- Example 4 --------------

Get-VDPortGroup -Name MyVDPortGroup | Get-VMHostNetworkAdapter

Retrieves VMHost network adapters by a specified distributed port group.

-------------- Example 5 --------------

$myVirtualSwitch = Get-VirtualSwitch -Name MyVirtualSwitch
Get-VMHostNetworkAdapter -VirtualSwitch $myVirtualSwitch

Retrieves physical VMHost network adapters by a specified standard virtual switch.


Copyright © 1998 - 2014 VMware, Inc. All rights reserved.