PowerCLI Reference

Set-CINetworkAdapter

Synopsis

This cmdlet modifies the configuration of a virtual network adapter of a virtual machine on a vCloud Director server.

Syntax

Set-CINetworkAdapter [-NetworkAdapter] <CINetworkAdapter[]> [-Connected <Boolean>] [-IPAddress <IPAddress>] [-IPAddressAllocationMode <IPAddressAllocationMode>] [-MACAddress <String>] [-VAppNetwork <CIVAppNetwork>] [-Primary] [-Server <CIServer[]>] [-ResetMACAddress] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-CINetworkAdapter

Detailed Description

This cmdlet modifies the configuration of a virtual network adapter of a virtual machine on a vCloud Director server.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NetworkAdapterCINetworkAdapter[]Specifies the virtual network adapters that 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
ConnectedBooleanSpecifies the connection state of the virtual network adapter. For an undeployed virtual machine, indicates that the virtual network adapter will connect to the network when the virtual machine is deployed.falsefalse
IPAddressIPAddressSpecifies a new IP address for the virtual network adapter. This parameter is only applicable when the IPAddressAllocationMode parameter is set to manual.falsefalse
IPAddressAllocationModeIPAddressAllocationModeSpecifies a new IP address allocation mode for the virtual network adapter. This parameter accepts Pool, Dhcp, and Manual values.falsefalse
MACAddressStringSpecifies a new MAC address for the virtual network adapter. This parameter is not applicable when ResetMACAddress is specified.falsefalse
PrimarySwitchParameterIndicates that the virtual network adapter is primary for its virtual machine.falsefalse
ResetMACAddressSwitchParameterIndicates that you want to reset the MAC address of the virtual network adapter. This parameter is not applicable when MACAddress is specified.falsefalse
ServerCIServer[]Specifies the cloud 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-CIServer.falsefalse
VAppNetworkCIVAppNetworkSpecifies a new vApp network to which the virtual network adapter connects. To disconnect the adapter from the vApp networks it connects to, pass $null.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

Zero or more modified CINetworkAdapter objects

Notes

Examples

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

$myVappNetwork2 = Get-CIVAppNetwork -Name 'MyVappNetwork2'
Get-CIVAppNetwork -Name 'MyVappNetwork1' | Get-CINetworkAdapter | Set-CINetworkAdapter -VAppNetwork $myVappNetwork2

Retrieves all virtual network adapters connected to the MyVappNetwork1 vApp network and connects them to the MyVappNetwork2 vApp network.

-------------- Example 2 --------------

Get-VApp -Name 'MyVapp1' | Get-CIVM | Get-CINetworkAdapter | Set-CINetworkAdapter -Connected $false

Disconnects all virtual network adapters of all virtual machines in the specified vApp.

-------------- Example 3 --------------

Get-CIVM -Name 'MyVM1' | Get-CINetworkAdapter -Primary | Set-CINetworkAdapter -IPAddressAllocationMode Manual -IPAddress 192.168.1.1 -MACAddress 'FF-1D-09-2E-D5-55'

Retrieves the primary virtual network adapter of the specified virtual machine. Changes the IP address allocation mode for the virtual network adapter to manual and assigns the virtual network adapter new IP and MAC addresses.


Copyright © VMware, Inc. All rights reserved.