VMware: Add PortGroup to all hosts in cluster with PowerCLI

17

Today we configured a new VLAN on the physical switches, now we need to configure a portgroup with vlan id on multiple ESX hosts in our cluster. To do this by hand it will cost 3 minutes per host, to script this.. you configure this in 10 seconds!

The script:

Get-Cluster “clustername” | Get-VMHost | Get-VirtualSwitch -Name “vSwitch0” | New-VirtualPortGroup -Name “VLAN-23-Citrix Provisioning” -VLanId 23

image

image

Voila!

About Author

17 thoughts on “VMware: Add PortGroup to all hosts in cluster with PowerCLI

Leave a Reply

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