Skip to content

Commit

Permalink
Create Enable-PromiscuousModeHyper-V.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
arwidmark committed May 18, 2020
1 parent cbe8ad3 commit 9f78c73
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Scripts/Enable-PromiscuousModeHyper-V.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Enable Promiscuous Mode for an external virtual switch in Hyper-V
$VMSwitch = "Chicago1"
$portFeature = Get-VMSystemSwitchExtensionPortFeature -FeatureName "Ethernet Switch Port Security Settings"
# None = 0, Destination = 1, Source = 2
$portFeature.SettingData.MonitorMode = 2
Add-VMSwitchExtensionPortFeature -ExternalPort -SwitchName $VMSwitch -VMSwitchExtensionFeature $portFeature

# Show settings
Get-VMSwitchExtensionPortFeature -ExternalPort -SwitchName $VMSwitch –FeatureName "Ethernet Switch Port Security Settings"
Get-VMSwitchExtensionPortFeature -ExternalPort -SwitchName $VMSwitch | select -ExpandProperty SettingData

0 comments on commit 9f78c73

Please sign in to comment.