< Back

Set-VDPortgroup

Sun Jan 19, 2020 7:24 pm

NAME Set-VDPortgroup



SYNOPSIS

This cmdlet modifies the configuration of distributed port groups.





SYNTAX

Set-VDPortgroup [-VDPortgroup] <VDPortgroup[]> -BackupPath <String> [-RunAsync] [-Server <VIServer[]>] [-Confirm]

[-WhatIf] [<CommonParameters>]



Set-VDPortgroup [-VDPortgroup] <VDPortgroup[]> [-DisableVlan] [-Name <String>] [-Notes <String>] [-NumPorts

<Int32>] [-PortBinding <DistributedPortGroupPortBinding>] [-PrivateVlanId <Int32>] [-RunAsync] [-Server

<VIServer[]>] [-VlanId <Int32>] [-VlanTrunkRange <VlanRangeList>] [-Confirm] [-WhatIf] [<CommonParameters>]



Set-VDPortgroup [-VDPortgroup] <VDPortgroup[]> -RollbackConfiguration [-RunAsync] [-Server <VIServer[]>]

[-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

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.





PARAMETERS

-BackupPath <String>

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? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DisableVlan [<SwitchParameter>]

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.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a new name for the distributed port group that you want to configure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Notes <String>

Specifies a new description for the distributed port group that you want to configure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-NumPorts <Int32>

Specifies a new number of ports on the distributed port group that you want to configure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PortBinding <DistributedPortGroupPortBinding>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PrivateVlanId <Int32>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RollbackConfiguration [<SwitchParameter>]

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? true

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-RunAsync [<SwitchParameter>]

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.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Server <VIServer[]>

Specifies the vCenter Server systems 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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-VDPortgroup <VDPortgroup[]>

Specifies the distributed port group that you want to configure.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



-VlanId <Int32>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VlanTrunkRange <VlanRangeList>

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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-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.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

The modified VDPortgroup objects







NOTES









-------------------------- 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 LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... group.html

Get-VDPortgroup

New-VDPortgroup

Remove-VDPortgroup

Export-VDPortgroup