vSphere PowerCLI Cmdlets Reference

Set-NetworkAdapter

Synopsis

Changes the configuration of the virtual network adapter.

Syntax

Set-NetworkAdapter [-NetworkAdapter] <NetworkAdapter[]> [-MacAddress <String>] [-NetworkName <String>] [-StartConnected [<Boolean>]] [-Connected [<Boolean>]] [-WakeOnLan [<Boolean>]] [-Type <VirtualNetworkAdapterType>] [-PortKey <String>] [-DistributedSwitch <DistributedSwitch>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-NetworkAdapter
New-NetworkAdapter
Remove-NetworkAdapter

Detailed Description

Changes the configuration of the virtual network adapter. You can change the MAC address and the network name, and to configure the Connected, StartConnected, and WakeOnLan properties of the adapter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NetworkAdapterNetworkAdapter[]Specify the virtual network adapter you want to configure.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
ConnectedBooleanIf the value is $true, the virtual network adapter is connected after its creation. If the value is $false, it is disconnected.falsefalse
DistributedSwitchDistributedSwitchSpecify a virtual switch to which you want to connect the network adapter.falsefalse
MacAddressStringSpecify an optional MAC address for the virtual network adapter.falsefalse
NetworkNameStringSpecify the name of the network to which you want to connect the virtual network adapter.falsefalse
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.falsefalse
StartConnectedBooleanIf the value is $true, the virtual network adapter starts connected when its associated virtual machine powers on. If the value is $false, it starts disconnected.falsefalse
TypeVirtualNetworkAdapterTypeSpecify the type of the network adapter. The valid types are e1000, Flexible, Vmxnet, EnhancedVmxnet, and Vmxnet3, and Unknown.falsefalse
WakeOnLanBooleanIndicate that wake-on-LAN is enabled on the 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

NetworkAdapter

Notes

Examples

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

$networkadapter = Set-NetworkAdapter -NetworkAdapter $oldAdapter -MacAddress '00:50:56:a1:00:00' -WakeOnLan:$true - StartConnected:$true -Connected:$true -NetworkName 'VM Network'

Sets a network adapter with the specified parameters.


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