Mass-VDI reconfiguration on vSphere with PowerCLI

A colleague asked me if there was an easy way to reconfigure VM´s that was on different hosts with PowerCLI, for some reason the VM´s had been configured with too many vCPU´s and the customer wanted a way to reconfigure the running VM´s.

I made a very easy PowerCLI script to solve this, maybe there is other solutions that might be better/more beautiful but this one solved the issue 🙂

You save this as a script and then run it with the starting name of the VM´s you want to configure, and as you can see you have to already have connected to the vcenter with Connect-VIServer before running it:

Screen Shot 2015-02-16 at 10.25.27

happy automating 🙂