Skip to content

Instantly share code, notes, and snippets.

@joeywas
Created October 19, 2015 22:30
Show Gist options
  • Save joeywas/38cfc4e6bec7d71c25aa to your computer and use it in GitHub Desktop.
Save joeywas/38cfc4e6bec7d71c25aa to your computer and use it in GitHub Desktop.
Add new virtual port group on all vswitches on all hosts
Foreach ($vmhost in (get-vmhost))
{
$vswitch0 = Get-VirtualSwitch -VMHost $vmhost -Name vSwitch0
New-VirtualPortGroup -VirtualSwitch $vswitch0 -Name VLAN200 -VLanID 200
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment