Syntax
Set-VDSwitch [-VDSwitch] <VDSwitch[]> -BackupPath <String> [-RunAsync] [-Server <VIServer[]>] [-WithoutPortGroups] [-Confirm] [-WhatIf] [<CommonParameters>]Related Commands
Online VersionDetailed Description
This cmdlet modifies the configuration of vSphere distributed switches. You can set the properties of the vSphere distributed switch manually, rollback the configuration to its previous state, or import it from a backup profile.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
VDSwitch | VDSwitch[] | Specifies the vSphere distributed switch that you want to configure. | true | True (ByValue) | |
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-VDSwitch cmdlet.
Note: This parameter is supported only on vSphere 5.1 and later. | true | 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. | false | False | |
ContactDetails | String | Specifies new contact details of the vSphere distributed switch administrator. | false | False | |
ContactName | String | Specifies a new name for the vSphere distributed switch administrator. | false | False | |
LinkDiscoveryProtocol | LinkDiscoveryProtocol | Specifies the link discovery protocol for the vSphere distributed switch that you want to configure. This parameter accepts CDP and LLDP values. | false | False | |
LinkDiscoveryProtocolOperation | LinkDiscoveryOperation | Specifies the link discovery protocol operation for the vSphere distributed switch that you want to configure. This parameter accepts Advertise, Listen, Both, and Disabled values. | false | False | |
MaxPorts | Int32 | Specifies the maximum number of ports allowed on the vSphere distributed switch that you want to configure. | false | False | |
Mtu | Int32 | Specifies the maximum MTU size for the vSphere distributed switch that you want to configure. Valid values are positive integers only. | false | False | |
Name | String | Specifies a new name for the vSphere distributed switch that you want to configure. | false | False | |
Notes | String | Specifies a new description for the vSphere distributed switch that you want to configure. | false | False | |
NumUplinkPorts | Int32 | Specifies the number of uplink ports on the vSphere distributed switch that you want to configure. | false | False | |
RollBackConfiguration | SwitchParameter | Indicates that you want to rollback the configuration of the vSphere distributed switch to an earlier state.
Note: This parameter is supported only on vSphere 5.1 and later. | true | 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. | false | 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. | false | False | |
Version | String | Specifies a new version for the vSphere distributed switch that you want to configure. This parameter accepts 4.0, 4.1.0, 5.0.0, 5.1.0, 5.5.0, and 6.0.0 values. You cannot specify a version that is incompatible with the version of the vCenter Server system you are connected to. | 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 | |
WithoutPortGroups | SwitchParameter | Indicates that the specified backup configuration is imported without its port groups.
Note: This parameter is supported only on vSphere 5.1 and later. | false | False |
Return Type
The modified VDSwitch objectsNotes
Examples
-------------------------- Example 1 --------------------------
Get-VDSwitch -Name "MyVDSwitch" | Set-VDSwitch -MaxPorts 1000 -NumUplinkPorts 8 -Mtu 2000
Modifies the maximum number of ports, the number of uplink ports, and the maximum MTU size of the specified vSphere distributed switch.
-------------------------- Example 2 --------------------------
$myVDSwitches = Get-VDSwitch -Name MyVDSwitch* Set-VDSwitch -VDSwitch $myVDSwitches -Version '5.1.0'
Changes the version of all vSphere distributed switches whose names start with "MyVDSwitch".
-------------------------- Example 3 --------------------------
$myVDSwitch = Get-VDSwitch -Name "MyVDSwitch" Set-VDSwitch -VDSwitch $myVDSwitch -LinkDiscoveryProtocol LLDP -LinkDiscoveryProtocolOperation Listen
Enables link discovery protocol on the specified vSphere distributed switch, sets it to LLDP and changes the link discovery protocol operation to listen.
-------------------------- Example 4 --------------------------
Get-VDSwitch -Name "MyVDSwitch" | Set-VDSwitch -BackupPath 'c:\MyVDSwitchBackups\MyVDSwitch_12_12_2012.zip' -WithoutPortGroups
Reconfigures the specified vSphere distributed switch by importing the specified backup profile. The original port groups are not recreated.
-------------------------- Example 5 --------------------------
Get-VDSwitch -Name "MyVDSwitch" | Set-VDSwitch -RollbackConfiguration
Rollbacks the configuration of the specified vSphere distributed switch to its previous state.