vSphere PowerCLI Reference



Modifies the provided OS customization NIC mappings.


Set-OSCustomizationNicMapping -OSCustomizationNicMapping <OSCustomizationNicMapping[]> [-Position <Int32>] [-Server <VIServer[]>] [-IpMode <OSCustomizationIPMode>] [-VCApplicationArgument <String>] [[-IpAddress] <String>] [[-SubnetMask] <String>] [[-DefaultGateway] <String>] [-AlternateGateway <String>] [[-Dns] <String[]>] [-Wins <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-OSCustomizationNicMapping -OSCustomizationNicMapping <OSCustomizationNicMapping[]> [-NetworkAdapterMac <String>] [-Server <VIServer[]>] [-IpMode <OSCustomizationIPMode>] [-VCApplicationArgument <String>] [[-IpAddress] <String>] [[-SubnetMask] <String>] [[-DefaultGateway] <String>] [-AlternateGateway <String>] [[-Dns] <String[]>] [-Wins <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version

Detailed Description

Modifies the provided OS customization NIC mappings. If the parent spec of the provided NIC mapping is a server-side spec, it is updated on the server. If the parent spec is client-side, the reference that is kept in the memory is updated, but the variable that is passed to the cmdlet is not modified.


NameTypeDescriptionRequired?Pipeline InputDefault Value
IpAddressStringSpecify an IP address. Using this parameter automatically sets the IpMode parameter to UseStaticIp.falsefalse
SubnetMaskStringSpecify a subnet mask.falsefalse
DefaultGatewayStringSpecify a default gateway.falsefalse
DnsString[]Specify a DNS address.falsefalse
AlternateGatewayStringSpecify an alternate gateway.falsefalse
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
IpModeOSCustomizationIPModeSpecify the IP configuration mode. The valid values are UseDhcp, PromptUser, UseVCApplication, and UseStaticIP.falsefalseUseDhcp
NetworkAdapterMacStringSpecify the MAC address of the network adapter to which you want to map the OS customization specification.falsefalse
OSCustomizationNicMappingOSCustomizationNicMapping[]Specify the OS customization NIC mapping you want to configure.truetrue (ByValue)
PositionInt32Specify the position of the mapping you want to modify.falsefalselast
ServerVIServer[]Specify the vSphere 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-VIServer.falsefalse
VCApplicationArgumentStringSpecify a new argument you want to pass to VCApplication in order to obtain an IP address.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse
WinsString[]Specify WINS servers.falsefalse

Return Type




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

Get-OSCustomizationSpec Spec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpAddress

Modifies the IP address of the specified NIC mapping that uses static IP mode.

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

Get-OSCustomizationSpec Spec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -VcApplicationArgument "subnet2"

Modifies the VCApplication argument of the specified NIC mapping.

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

Get-OSCustomizationSpec Spec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIp -IpAddress -SubnetMask -DefaultGateway -AlternateGateway -Dns -PrimaryWins

Modifies the attributes of a NIC mapping.

-------------- Example 4 --------------

Set-OSCustomizationNicMapping -OSCustomizationNicMapping $nicMapping1, $nicMapping2 -IPMode UseVCApplication -VcApplicationArgument "subnet2"

Modifies the specified NIC mapping using VCApplication.

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