Set-VDPortgroup Command | Vmware PowerCLI Reference

Set-VDPortgroup

This cmdlet modifies the configuration of distributed port groups. You can set the properties of the distributed port group manually, provide a backup profile to import the port group configuration, or rollback to the last valid configuration.Note: You can import or rollback a configuration only on vSphere 5.1 and later.

Syntax

Set-VDPortgroup
-VDPortgroup < VDPortgroup[] >
[-DisableVlan ]
[-Name < String > ]
[-Notes < String > ]
[-NumPorts < Int32 > ]
[-PortBinding < DistributedPortGroupPortBinding > ]
[-PrivateVlanId < Int32 > ]
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[-VlanId < Int32 > ]
[-VlanTrunkRange < VlanRangeList > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VDPortgroup VDPortgroup[] named
  • pipeline
  • wildcards
Specifies the distributed port group that you want to configure.
optional DisableVlan SwitchParameter named
Sets the VLAN type of the distributed port group to None. This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.
optional Name String named
Specifies a new name for the distributed port group that you want to configure.
optional Notes String named
  • wildcards
Specifies a new description for the distributed port group that you want to configure.
optional NumPorts Int32 named
Specifies a new number of ports on the distributed port group that you want to configure.
optional PortBinding DistributedPortGroupPortBinding named
Specifies a new port binding setting for the distributed port group that you want to configure. This parameter accepts Static, Dynamic, and Ephemeral values. Note: Dynamic port binding is deprecated. For better performance, static port binding is recommended.
optional PrivateVlanId Int32 named
Specifies the secondary VLAN ID of a vSphere distributed switch's private VLAN configuration entry. This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems 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-VIServer.
optional VlanId Int32 named
Specifies a new VLAN ID for the distributed port group that you want to configure. The VLAN IDs of 0 and 4095 are reserved and cannot be used. This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.
optional VlanTrunkRange VlanRangeList named
Specifies a new VLAN trunk range for the distributed port group that you want to configure. Valid values are strings representing ranges of IDs. For example, "1-4, 6, 8-9". This parameter is obsolete. Use the corresponding parameter from the Set-VDVlanConfiguration cmdlet instead.
Set-VDPortgroup
-BackupPath < String >
-VDPortgroup < VDPortgroup[] >
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
BackupPath String named
Specifies the full file path to the .zip file containing the backup configuration that you want to import. You can import only .zip files created with the Export-VDPortgroup cmdlet. Note: This parameter is only supported on vSphere 5.1 and later.
required
VDPortgroup VDPortgroup[] named
  • pipeline
  • wildcards
Specifies the distributed port group that you want to configure.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems 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-VIServer.
Set-VDPortgroup
-RollbackConfiguration
-VDPortgroup < VDPortgroup[] >
[-ProgressAction < ActionPreference > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
RollbackConfiguration SwitchParameter named
Indicates that you want to rollback the distributed port group to its last valid configuration. Note: Rollback is available only on vSphere 5.1 and later.
required
VDPortgroup VDPortgroup[] named
  • pipeline
  • wildcards
Specifies the distributed port group that you want to configure.
optional ProgressAction ActionPreference named
optional RunAsync SwitchParameter named
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the RunAsync parameter run "help About_RunAsync" in the VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems 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-VIServer.

Output

VMware.VimAutomation.Vds.Types.V1.VDPortgroup

Examples

Example 1

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -Name "MyNewVDPortGroupName" -NumPorts 5 -VlanId 4

Changes the name, number of ports and the VLAN ID of all distributed port groups named "MyVDPortGroup".

Example 2

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -VlanTrunkRange "1-5, 8-10"

Changes the VLAN trunk range of all distributed port groups named "MyVDPortGroup".

Example 3

$myVDPortgroup = Get-VDPortgroup -Name "MyVDPortGroup" -VDSwitch "MyVDSwitch"
Set-VDPortgroup -VDPortgroup $myVDPortgroup -DisableVlan

Sets the VLAN type of the specified distributed port group to None.

Example 4

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -RollbackConfiguration

Rollbacks the configuration of all distributed port groups named "MyVDPortGroup".

Example 5

Get-VDPortgroup -Name "MyVDPortGroup" | Set-VDPortgroup -BackupPath 'c:\backup.zip'

Reconfigures all distributed port groups named "MyVDPortGroup" by importing the configuration from the specified backup profile.

Related Commands

VDPort

This cmdlet retrieves virtual distributed ports.

This cmdlet modifies the configuration of virtual distributed ports.

VDPortGroup

This cmdlet exports the configuration of a specified distributed port group to a specified .zip file.

This cmdlet removes distributed port groups.

VDPortgroup

This cmdlet retrieves distributed port groups.

This cmdlet creates distributed port groups.

This cmdlet modifies the configuration of distributed port groups.

VDPortgroupOverridePolicy

This cmdlet retrieves the policy for overriding port group settings at port level.

This cmdlet modifies the policy for overriding port group settings at port level.