Syntax
Set-CINetworkAdapter [-NetworkAdapter] <CINetworkAdapter[]> [-Connected <Boolean>] [-IPAddress <IPAddress>] [-IPAddressAllocationMode <IPAddressAllocationMode>] [-MACAddress <String>] [-Primary] [-ResetMACAddress] [-Server <CIServer[]>] [-VAppNetwork <CIVAppNetwork>] [-Confirm] [-WhatIf] [<CommonParameters>]Related Commands
Online VersionDetailed Description
This cmdlet modifies the configuration of a virtual network adapter of a virtual machine on a vCloud Director server.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
NetworkAdapter | CINetworkAdapter[] | Specifies the virtual network adapters that you want to configure. | true | True (ByValue) | |
Confirm | SwitchParameter | If 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. | false | False | |
Connected | Boolean | 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. | false | False | |
IPAddress | IPAddress | Specifies a new IP address for the virtual network adapter. This parameter is only applicable when the IPAddressAllocationMode parameter is set to manual. | false | False | |
IPAddressAllocationMode | IPAddressAllocationMode | Specifies a new IP address allocation mode for the virtual network adapter. This parameter accepts Pool, Dhcp, and Manual values. | false | False | |
MACAddress | String | Specifies a new MAC address for the virtual network adapter. This parameter is not applicable when ResetMACAddress is specified. | false | False | |
Primary | SwitchParameter | Indicates that the virtual network adapter is primary for its virtual machine. | false | False | |
ResetMACAddress | SwitchParameter | Indicates that you want to reset the MAC address of the virtual network adapter. This parameter is not applicable when MACAddress is specified. | false | False | |
Server | CIServer[] | 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. | false | False | |
VAppNetwork | CIVAppNetwork | 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. | false | False | |
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | False |
Return Type
Zero or more modified CINetworkAdapter objectsNotes
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.