Set-VDVlanConfiguration Command | Vmware PowerCLI Reference

Set-VDVlanConfiguration

This cmdlet modifies the virtual distributed port's VLAN configuration. For vSphere distributed switch and port group parameter sets, the cmdlet modifies the respective default port configuration.

Syntax

Set-VDVlanConfiguration
-VDPort < VDPort[] >
[-DisableVlan ]
[-PrivateVlanId < Int32 > ]
[-ProgressAction < ActionPreference > ]
[-VlanId < Int32 > ]
[-VlanTrunkRange < VlanRangeList > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VDPort VDPort[] named
  • pipeline
Specifies the port whose VLAN configuration you want to modify.
optional DisableVlan SwitchParameter named
Sets the VLAN type to None.
optional PrivateVlanId Int32 named
Specifies the secondary VLAN ID of a vSphere distributed switch's private VLAN configuration entry. The VLAN IDs of 0 and 4095 are reserved and cannot be used.
optional ProgressAction ActionPreference named
optional VlanId Int32 named
Specifies a new VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used.
optional VlanTrunkRange VlanRangeList named
Specifies a new VLAN trunk range. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9".
Set-VDVlanConfiguration
-VDPortgroup < VDPortgroup[] >
[-DisableVlan ]
[-PrivateVlanId < Int32 > ]
[-ProgressAction < ActionPreference > ]
[-VlanId < Int32 > ]
[-VlanTrunkRange < VlanRangeList > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VDPortgroup VDPortgroup[] named
  • pipeline
Specifies the port group whose default VLAN port configuration you want to modify.
optional DisableVlan SwitchParameter named
Sets the VLAN type to None.
optional PrivateVlanId Int32 named
Specifies the secondary VLAN ID of a vSphere distributed switch's private VLAN configuration entry. The VLAN IDs of 0 and 4095 are reserved and cannot be used.
optional ProgressAction ActionPreference named
optional VlanId Int32 named
Specifies a new VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used.
optional VlanTrunkRange VlanRangeList named
Specifies a new VLAN trunk range. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9".
Set-VDVlanConfiguration
-VDSwitch < VDSwitch[] >
[-DisableVlan ]
[-PrivateVlanId < Int32 > ]
[-ProgressAction < ActionPreference > ]
[-VlanId < Int32 > ]
[-VlanTrunkRange < VlanRangeList > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VDSwitch VDSwitch[] named
  • pipeline
Specifies the vSphere distributed switch whose default VLAN port configuration you want to modify.
optional DisableVlan SwitchParameter named
Sets the VLAN type to None.
optional PrivateVlanId Int32 named
Specifies the secondary VLAN ID of a vSphere distributed switch's private VLAN configuration entry. The VLAN IDs of 0 and 4095 are reserved and cannot be used.
optional ProgressAction ActionPreference named
optional VlanId Int32 named
Specifies a new VLAN ID. The VLAN IDs of 0 and 4095 are reserved and cannot be used.
optional VlanTrunkRange VlanRangeList named
Specifies a new VLAN trunk range. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9".

Output

VMware.VimAutomation.Vds.Types.V1.VlanConfiguration

Examples

Example 1

Get-VDSwitch "MyVDSwitch" | Get-VDPort -ActiveOnly | Set-VDVlanConfiguration -PrivateVlanId 4

Assigns all active ports of a specific vSphere distributed switch named "MyVDSwitch" to a private VLAN with ID "4".

Example 2

Get-VDPortgroup "MyVDPorgroup" | Get-VDPort | Set-VDVlanConfiguration -VlanId 3

Assigns all ports of a specific distributed port group named "MyVDPorgroup" to a VLAN with ID "3".

Related Commands

VDVlanConfiguration

This cmdlet modifies the virtual distributed port's VLAN configuration.