Set-CINetworkAdapter Command | Vmware PowerCLI Reference

Set-CINetworkAdapter

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 > ]
[-Primary ]
[-ProgressAction < ActionPreference > ]
[-ResetMACAddress ]
[-Server < CIServer[] > ]
[-VAppNetwork < CIVAppNetwork > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
NetworkAdapter CINetworkAdapter[] named
  • pipeline
Specifies the virtual network adapters that you want to configure.
optional Connected Boolean named
Specifies 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.
optional IPAddress IPAddress named
Specifies a new IP address for the virtual network adapter. This parameter is only applicable when the IPAddressAllocationMode parameter is set to manual.
optional IPAddressAllocationMode IPAddressAllocationMode named
Specifies a new IP address allocation mode for the virtual network adapter. This parameter accepts Pool, Dhcp, and Manual values.
optional MACAddress String named
Specifies a new MAC address for the virtual network adapter. This parameter is not applicable when ResetMACAddress is specified.
optional Primary SwitchParameter named
Indicates that the virtual network adapter is primary for its virtual machine.
optional ProgressAction ActionPreference named
optional ResetMACAddress SwitchParameter named
Indicates that you want to reset the MAC address of the virtual network adapter. This parameter is not applicable when MACAddress is specified.
optional Server CIServer[] named
Specifies the cloud servers on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-CIServer.
optional VAppNetwork CIVAppNetwork named
Specifies a new vApp network to which the virtual network adapter connects. To disconnect the adapter from the vApp networks it connects to, pass $null.

Output

VMware.VimAutomation.Cloud.Types.V1.CINetworkAdapter

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.

Related Commands

CINetworkAdapter

This cmdlet retrieves the virtual network adapters available on a vCloud Director server.

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