Get-NetworkAdapter Command | Vmware PowerCLI Reference

Get-NetworkAdapter

This cmdlet retrieves the virtual network adapters available on a vCenter Server system. The cmdlet returns a set of virtual network adapters assigned to the virtual machines, templates, and snapshots specified by the VirtualMachine, Template, and Snapshot parameters. At least one of these parameters must be provided. To specify a server different from the default one, use the Server parameter.

Syntax

Get-NetworkAdapter
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
RelatedObject NetworkAdapterRelatedObjectBase[] named
  • pipeline
Specify an object to retrieve one or more network adapters that are related to the object. This parameter accepts standard and distributed port groups.
Get-NetworkAdapter
[ [-Template ] < Template[] > ]
[ [-Snapshot ] < Snapshot[] > ]
[-Id < String[] > ]
[-Name < String[] > ]
[-Server < VIServer[] > ]
[-VM < VirtualMachine[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional Template Template[] 1
  • pipeline
  • wildcards
Specifies the templates from which you want to retrieve virtual network adapters.
optional Snapshot Snapshot[] 2
  • pipeline
Specifies the snapshots from which you want to retrieve virtual network adapters.
optional Id String[] named
  • wildcards
Specifies the IDs of the 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.
optional Name String[] named
  • wildcards
Specifies the names of the network adapters you want to retrieve.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null 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.
optional VM VirtualMachine[] named
  • pipeline
  • wildcards
Specifies the virtual machines from which you want to retrieve virtual network adapters.

Output

VMware.VimAutomation.ViCore.Types.V1.VirtualDevice.NetworkAdapter

Examples

Example 1

Get-NetworkAdapter -VM MyVM

Retrieves the network adapters added to the the MyVM virtual machine.

Example 2

$myVDPortgroup = Get-VDPortGroup -Name "MyVDPortGroup"
$myNetworkAdapters = Get-NetworkAdapter -RelatedObject $myVDPortgroup

Retrieves all network adapters connected to the specified port group and stores them in the myNetworkAdapters variable.

Related Commands

NetworkAdapter

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

This cmdlet creates a new virtual network adapter.

This cmdlet removes the virtual network adapters from their locations.

This cmdlet modifies the configuration of the virtual network adapter.