vSphere PowerCLI Reference

Get-NetworkAdapter

Synopsis

Retrieves the virtual network adapters available on a vSphere server.

Syntax

Get-NetworkAdapter [[-VM] <VirtualMachine[]>] [[-Template] <Template[]>] [[-Snapshot] <Snapshot[]>] [-Id <String[]>] [-Name <String[]>] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
New-NetworkAdapter
Remove-NetworkAdapter
Set-NetworkAdapter

Detailed Description

Retrieves the virtual network adapters available on a vSphere server. 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.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VMVirtualMachine[]Specify the virtual machines from which you want to retrieve virtual network adapters.falsetrue (ByValue)
TemplateTemplate[]Specify the templates from which you want to retrieve virtual network adapters.falsetrue (ByValue)
SnapshotSnapshot[]Specify the snapshots from which you want to retrieve virtual network adapters.falsetrue (ByValue)
IdString[]Specify the Id of the network adapters you want to retrieve.falsefalse
NameString[]Specify the names of the network adapters you want to retrieve.falsefalse
ServerVIServer[]Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse

Return Type

NetworkAdapter

Notes

Examples

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

Get-NetworkAdapter -VM VM

Retrieves the network adapter assigned the VM virtual machine.





MacAddress : 00:30:56:94:0a:1a
WakeOnLanEnabled : True
NetworkName : VM Network
ConnectionState : VMware.VimAutomation.Client20.ConnectInfoImpl
Id : VirtualMachine-vm-16/4000
Name : Network Adapter 1


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