That depends on how your infrastructure is configured.
Changing the vlan id on a vm port group means that all VMs may not be reachable (if it is not done right).
I would prefer, to create a new port group with the new vlan and then move the VMs to the new port group, one by one (of course with a script) and perform a PING after each change so that you're sure that the VMs are reachable on the network.
Can you tell us more about your infrastructure, then we can write some kind of script that helps you automate that.