< Back

Get-VMHostNetworkAdapter

Sun Jan 19, 2020 6:55 pm

NAME Get-VMHostNetworkAdapter



SYNOPSIS

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





SYNTAX

Get-VMHostNetworkAdapter [[-VirtualSwitch] <VirtualSwitchBase[]>] [[-Name] <String[]>] [-Console] [-Id <String[]>]

[-Physical] [-PortGroup <VirtualPortGroupBase[]>] [-Server <VIServer[]>] [-VMHost <VMHost[]>] [-VMKernel]

[<CommonParameters>]





DESCRIPTION

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





PARAMETERS

-Console [<SwitchParameter>]

Indicates that you want to retrieve only service console virtual network adapters.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Id <String[]>

Specifies the IDs of the host network adapters you want to retrieve.



Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that

matches exactly one of the string values in that list.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Name <String[]>

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.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Physical [<SwitchParameter>]

Indicates that you want to retrieve only physical network adapters.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-PortGroup <VirtualPortGroupBase[]>

Specifies the port groups to which network adapters that you want to retrieve are connected.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Server <VIServer[]>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-VirtualSwitch <VirtualSwitchBase[]>

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.



Required? false

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-VMHost <VMHost[]>

Specifies the hosts whose network adapters you want to retrieve. The position of this parameter is deprecated

and might change in a following release.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-VMKernel [<SwitchParameter>]

Indicates that you want to retrieve only VMKernel virtual network adapters.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more HostVirtualNic objects







NOTES









-------------------------- 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.



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... apter.html

New-VMHostNetworkAdapter

Remove-VMHostNetworkAdapter

Set-VMHostNetworkAdapter