Syntax
Set-CINetworkAdapter [-NetworkAdapter] <CINetworkAdapter[]> [-Connected <Boolean>] [-IPAddress <IPAddress>] [-IPAddressAllocationMode <IPAddressAllocationMode>] [-MACAddress <String>] [-VAppNetwork <CIVAppNetwork>] [-Primary] [-Server <CIServer[]>] [-ResetMACAddress] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [-WhatIf] [-Confirm] [<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 | |
InformationAction | ActionPreference | false | false | ||
InformationVariable | String | 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 | |
PipelineVariable | String | 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.