< Back

Set-VDSwitch

Sun Jan 19, 2020 7:24 pm

NAME Set-VDSwitch



SYNOPSIS

This cmdlet modifies the configuration of vSphere distributed switches.





SYNTAX

Set-VDSwitch [-VDSwitch] <VDSwitch[]> -BackupPath <String> [-RunAsync] [-Server <VIServer[]>] [-WithoutPortGroups]

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



Set-VDSwitch [-VDSwitch] <VDSwitch[]> [-ContactDetails <String>] [-ContactName <String>] [-LinkDiscoveryProtocol

<LinkDiscoveryProtocol>] [-LinkDiscoveryProtocolOperation <LinkDiscoveryOperation>] [-MaxPorts <Int32>] [-Mtu

<Int32>] [-Name <String>] [-Notes <String>] [-NumUplinkPorts <Int32>] [-RunAsync] [-Server <VIServer[]>] [-Version

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



Set-VDSwitch [-VDSwitch] <VDSwitch[]> -RollBackConfiguration [-RunAsync] [-Server <VIServer[]>] [-Confirm]

[-WhatIf] [<CommonParameters>]





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.



Note: Rollback and importing are available 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-VDSwitch cmdlet.



Note: This parameter is supported only on vSphere 5.1 and later.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ContactDetails <String>

Specifies new contact details of the vSphere distributed switch administrator.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ContactName <String>

Specifies a new name for the vSphere distributed switch administrator.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-MaxPorts <Int32>

Specifies the maximum number of ports allowed on the vSphere distributed switch that you want to configure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Mtu <Int32>

Specifies the maximum MTU size for the vSphere distributed switch that you want to configure. Valid values are

positive integers only.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a new name for the vSphere distributed switch 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 vSphere distributed switch that you want to configure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NumUplinkPorts <Int32>

Specifies the number of uplink ports on the vSphere distributed switch that you want to configure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



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



-VDSwitch <VDSwitch[]>

Specifies the vSphere distributed switch that you want to configure.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? true



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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value False

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 VDSwitch objects







NOTES









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



RELATED LINKS

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

New-VDSwitch

Export-VDSwitch

Get-VDSwitch

Remove-VDSwitch