I recently lost access to few of my ESXi hosts after using the incorrect VLAN on the dvSwitch portgroup.
Was unable to find any command to change the VLAN of a dvSwitch portgroup from the command line.

Luckily I came across the Network Restore Option in DCUI

To restore VDS from DCUI:

  • Connect to the DCUI.
  • From the Network Restore Options menu, select Restore vDS.
  • Type the correct values for VLAN uplink and blocked properties, where appropriate.
  • Press Enter