Standard Switch, creating portgroups

      No Comments on Standard Switch, creating portgroups

I’m a big advocate of DVS, but licensing is not always available, so for those who use Standard Switches, here’s an error free way of creating Portgroups in all your ESXI hosts.

I say error free because there won’t be any typos as all PGs are created from the same command.

$switchname="myswitch"
$vlanID="100"
get-vmhost | foreach
{
new-VirtualPortGroup -name PG -VirtualSwitch (Get-virtualswitch -VMHost $_ -name $switchname) -VLAN $vlanID
}

Just replace the switchname and respective vlanID and you’ll be flying!

Leave a Reply

Your email address will not be published. Required fields are marked *