Created
October 18, 2016 19:34
-
-
Save nvpnathan/5cbe0e304b53e2de6419ed4df756293c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################ | |
# Configuration Settings # | |
############################################ | |
$switchName="NSBU-SE-VIO-VDS" | |
$promiscuous=$true | |
$forgedTransmits=$true | |
$macChanges=$true | |
################################################### | |
# Shouldn't need to edit anything below this line # | |
################################################### | |
$dvSwitch = Get-VDSwitch $switchname | |
$spec = New-Object VMware.Vim.VMwareDVSConfigSpec | |
$spec.configVersion = $dvswitch.ExtensionData.Config.ConfigVersion | |
$spec.DefaultPortConfig = New-Object VMware.Vim.VMwareDVSPortSetting | |
$spec.DefaultPortConfig.SecurityPolicy = New-Object VMware.Vim.DVSSecurityPolicy | |
$spec.DefaultPortConfig.SecurityPolicy.AllowPromiscuous = New-Object VMware.Vim.BoolPolicy | |
$spec.DefaultPortConfig.SecurityPolicy.AllowPromiscuous.Value = $promiscuous | |
$spec.DefaultPortConfig.SecurityPolicy.MacChanges = New-Object VMware.Vim.BoolPolicy | |
$spec.DefaultPortConfig.SecurityPolicy.MacChanges.Value = $macChanges | |
$spec.DefaultPortConfig.SecurityPolicy.ForgedTransmits = New-Object VMware.Vim.BoolPolicy | |
$spec.DefaultPortConfig.SecurityPolicy.ForgedTransmits.Value = $forgedTransmits | |
$dvswitch.ExtensionData.ReconfigureDvs_Task($spec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment