Achievements

Advertisements

PowerCLI – Analyze a Cluster to Move VMs to a Resource Pool

After someone deployed a bunch of VMs, we let them know about the Resource Pool they were supposed to be deployed to. Oops. To correct this, and to avoid a couple hours of dragging and dropping VMs into a resource pool, I was able to create a script that detects if a VM is outside of a Resource Pool and then move it to the specified Resource Pool.

When you run the script, it will ask for the Cluster name and the Resource Pool name so you don’t have to modify the code.