Script to evacuate cluster node on shutdown

A little while ago David posted a really handy solution for evacuating a Hyper-V cluster node on shutdown automatically.

The issue that he is trying to address is that normally you should not just shutdown a node in a cluster, rather you should manually move all virtual machines off of the cluster node first.  If you just shutdown a node in a cluster all the virtual machines will be failed over using quick migration.

David solved this problem by writing a PowerShell script that works with clustering to live migrate the virtual machines to another node in the cluster.  He then uses group policy to get this script to be run automatically whenever a computer in his cluster is shutdown.

All-in-all it is a really cool solution to make your life a little easier.  You can read all about it here: