Remotely Shut down Hyper V server from Bat file (UPS shutdown)

hyper-v-server-2008-r2remote-accessups

I have set up an APC UPS on our 2003 Small Business Server with an APC SmartUPS connected to it via the USB port. I have set up PowerChute on the server with the following settings:

After 1 minute with no power run command file, after 2 mins start shuting down Exchange Service, after 3 mins start shuting down IIS, after 4 mins start shutting down SQL and finally after 10 mins start shutting down the OS.

All this works fine except in the command file, I want to send a remote command to shut down our Hyper V server, I'd normally use the shutdown command but I have a few concerns…

  1. If I shut down the Hyper V server with shutdown command what happens
    to the VMs?
  2. Do I have to shutdown each VM first?
  3. If so, will I have to keep updating the file every time a new
    machine is added?
  4. We are running a dedicated Hyper V server not a Windows server
    running Hyper V – as shutdown is a DOS command I know it should work
    anyway. But will the Hyper V server support it being run from a
    remote machine?

Best Answer

  1. Depending on the parameter they might have a forced shutdown (like power off ) with all the risks...

  2. It would be preferable to shutdown each machine first .

  3. You can use an array of elements , then add a new VM to that array when necessary .

  4. If you are admin on that station , yes like any other server , but keep in mind to give him enough time to exit gracefully , because if you shut it down quickly and forced you might experience some errors especially at VM's (orphane avhd files :) ).

    I would recommend running some tests (maybe a disaster recovery drill? ) . I had to run my own , and believe me it had worth it!