vSphere PowerCLI Cmdlets Reference



Creates a new virtual network adapter.


New-NetworkAdapter [-MacAddress <String>] -NetworkName <String> [-StartConnected] [-WakeOnLan] [-Type <VirtualNetworkAdapterType>] [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
New-NetworkAdapter [-MacAddress <String>] [-StartConnected] [-WakeOnLan] [-Type <VirtualNetworkAdapterType>] -PortKey <String> -DistributedSwitch <DistributedSwitch> [-VM] <VirtualMachine[]> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version

Detailed Description

Creates a new virtual network adapter for each of the provided virtual machines and sets the optional properties if provided.


NameTypeDescriptionRequired?Pipeline InputDefault Value
VMVirtualMachine[]Specify the virtual machines to which you want to attach the new virtual network adapter.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse$true
DistributedSwitchDistributedSwitchSpecify a virtual switch to which you want to connect the network adapter.falsefalse
MacAddressStringSpecify an optional MAC address for the new virtual network adapter.falsefalse
NetworkNameStringSpecify the name of the network to which you want to add the new virtual network adapter.truefalse
PortKeyStringSpecify the port of the virtual switch to which you want to connect the network adapter. Use this parameter only if the -VirtualSwitch parameter is specified.truefalse
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
StartConnectedSwitchParameterIndicate that the virtual network adapter starts connected when the virtual machine associated with it powers on.falsefalse
TypeVirtualNetworkAdapterTypeSpecify the type of the new network adapter. The valid types are e1000, Flexible, Vmxnet, EnhancedVmxnet, and Vmxnet3, and Unknown. If no value is given to the parameter, the new network adapter is of the type recommended by VMware for the given guest OS.falsefalse
WakeOnLanSwitchParameterIndicate that wake-on-LAN is enabled on the newly created virtual network adapter.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type



There are two special cases concerning the behavior of New-NetworkAdapter: - If you are directly connected to a standalone ESX host (that is not manag ed by a vCenter Server), the MAC address of the newly created network adapt er is generated after the associated virtual machine is powered on for a fi rst time. - If you are directly connected to an ESX host that is managed by a vCenter Server, the MAC address of the newly created network adapter is generated with a delay of several seconds.


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

New-NetworkAdapter -VM $vm -NetworkName "VM Network" -MacAddress  'aa:bb:cc:dd:ee:ff' -WakeOnLan -StartConnected

Creates a new network adapter named VM Network for the virtual machine.

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