New-NetworkAdapter

Synopsis

Creates a new virtual network adapter.

Syntax

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

Related Commands

Get-NetworkAdapter
Remove-NetworkAdapter
Set-NetworkAdapter

Detailed Description

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

Parameters

NameDescriptionRequired?Pipeline InputDefault Value
MacAddressSpecify an optional MAC address for the new virtual network adapter.falsefalse
NetworkNameSpecify the name of the network to which you want to add the new virtual network adapter.truefalse
StartConnectedIndicate that the virtual network adapter starts connected when the virtual machine associated with it powers on.falsefalse
WakeOnLanIndicate that wake-on-LAN is enabled on the newly created virtual network adapter.falsefalse
TypeSpecify the type of the new network adapter. The valid types are e1000, Flexible, Vmxnet, EnhancedVmxnet, and Vmxnet3. 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
VMSpecify the virtual machines to which you want to attach the new virtual network adapter.truetrue (ByValue)
ServerSpecify 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
WhatIfIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse
ConfirmIndicate that the cmdlet asks for confirmation before running.falsefalse

Input Type

Return Type

VMware.VimAutomation.Types.NetworkAdapter

Notes

Examples

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

C:\PS>$vm = Get-VM "XP SP2"

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


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

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