none
Hyper-V core and UPS

    Question

  • hi,
    how can i manage the UPS i have on my Hyper-V server?
    when it runs out of power it should also power down the Hyper-V server and its hosted VM's...
    or does the management of the UPS has to be run on another machine and then what?

    tia,
    marc
    Monday, January 12, 2009 7:56 AM

Answers

  • Mark,

    I don't take credit for creating this solution, but I can tell you I've tested it and now use it on my Hyper-V Server.  It works quite well.  I got this solution from the following thread:
    http://social.technet.microsoft.com/Forums/en/winservergen/thread/10fd4f4a-eba5-4577-8f81-28c1558eb2e7

    I put the following VBScript into local policy as a "machine startup" script on my Hyper-V Server.  The shutdown is graceful.  That is, the hypervisor gets its opportunity to save the states of the VMs prior to powering off.

    set wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
    set batteryColl = wmi.ExecQuery("select * from Win32_Battery")
    set osColl = wmi.ExecQuery("select * from Win32_OperatingSystem")
    
    while true
     for each battery in batteryColl
      battery.Refresh_
      if battery.batteryStatus = 1 and battery.EstimatedChargeRemaining <= 25 then
       for each os in osColl
        os.Win32Shutdown 5
       next
      end if
     next
     wscript.Sleep 15000
    wend
    Ryan
    • Marked as answer by DrWhoIs007 Tuesday, November 3, 2009 2:06 PM
    Tuesday, November 3, 2009 3:20 AM
  • Uninterruptible Power Supplies (UPSs) can be configured using network connections, USB connections and some solder models through serial connections. When the server running System Center Virtual Machine Manager (SCVMM) is running virtually you can connect to, and manage network connected UPSs. When it's a physical box you can connect to and manage network, USB- and serial connected UPS's (as long as the box offers the right physical connectors and right amount of them) 

    Since HP Uninterruptible Power Supplies (UPSs) are rebranded APC units, you can use the HP or APC software to remotely shutdown the virtual host. When you shutdown a single host running Hyper-V it will pause all guests and shutdown. The APC PowerChute software is especially powerful when you're running a geographically dispersed failover cluster ('geocluster') of Hyper-V servers: You can create Powershell scripts in System Center Virtual Machine Manager (SCVMM) to migrate the virtual guests to the other location (where there's no power outage?) and shut down the guest remotely with the script, triggered by the APC Powerchute software.

    When looking at the PCBE8 compat chart.pdf I noticed APC Powerchute Business Edition software is available for Server Core installations of Windows Server 2008. (both x86 and x64).

    Note:
    When using network connected UPSs, also connect your network components to the UPS. When using a geocluster to perform migrations, make sure every component used in these scenarios are UPS protected. Contact your ISP for information on the protection of components between your locations.

    • Marked as answer by DrWhoIs007 Thursday, January 15, 2009 9:08 AM
    Thursday, January 15, 2009 9:04 AM
  • Microsoft Windows Server 2008  and Microsoft Hyper-V Server do not offer a built-in tool to manage an Uninterruptible Power Supply (UPS) it is connected to, compared to Windows Server 2003.
      
    To manage an UPS, install the software for the UPS.
    You should ask the vendor or manufacturer of the UPS:
         
    • Whether the company supports Server Core installations of Windows Server 2008;
    • How the UPS is to be managed on a Server Core installation, when it's not manageable from the commandline.

     

    Monday, January 12, 2009 8:27 AM
  • Hi,

     

    As far as I know, SCVMM does not have the UPS management feature.

     

    If you have any further SCVMM related questions, you may post to the following System Center Virtual Machine Manger forum:

     

    System Center Virtual Machine Manager

    http://social.technet.microsoft.com/Forums/en-US/category/virtualmachinemanager/

     

     

    Best Regards,

    Vincent Hu

    Wednesday, January 14, 2009 7:06 AM
    Moderator

All replies

  • Microsoft Windows Server 2008  and Microsoft Hyper-V Server do not offer a built-in tool to manage an Uninterruptible Power Supply (UPS) it is connected to, compared to Windows Server 2003.
      
    To manage an UPS, install the software for the UPS.
    You should ask the vendor or manufacturer of the UPS:
         
    • Whether the company supports Server Core installations of Windows Server 2008;
    • How the UPS is to be managed on a Server Core installation, when it's not manageable from the commandline.

     

    Monday, January 12, 2009 8:27 AM
  • hi,
    could this be handled by the machine which is running SC-VMM08?
    thx
    marc
    Monday, January 12, 2009 8:31 AM
  • Hi,

     

    As far as I know, SCVMM does not have the UPS management feature.

     

    If you have any further SCVMM related questions, you may post to the following System Center Virtual Machine Manger forum:

     

    System Center Virtual Machine Manager

    http://social.technet.microsoft.com/Forums/en-US/category/virtualmachinemanager/

     

     

    Best Regards,

    Vincent Hu

    Wednesday, January 14, 2009 7:06 AM
    Moderator
  • hi vincent,
    i find this very odd...
    i should have expected that support for ups systems is included in a hypervisor.
    after all, how do you stop your VM's gracefully if one can't detect that power will be switched off....
    cu marc
    Wednesday, January 14, 2009 7:36 AM
  • Hi, DrWhoIs007


    I am not very familiar with UPS. But based on my research, you can administrater the UPS on every computer, not the specific one.

    You may contact the UPS vendor to get more information.

    I am sorry that I don't have a UPS here. 


    Best Regards,

    Vincent Hu

    Thursday, January 15, 2009 5:33 AM
    Moderator
  • hi vincent,
    indeed one can administer an ups on every 'normal' OS
    but that doesn't shutdown the hyper-v itself, keep in mind that i'm talking about the bare metal version here, so no gui to run HP programs in...
    the vendor, HP in this case doesn't mention anywhere if this is possible, a shutdown of the hyper-v (which in his turn shuts down every single VM running on this host), it is a classic case of playing ball...
    and i don't seem to get in touch with someone within HP who can help me further with this...
    so the only option i see is that sc-vmm has some tools to detect this and then shuts down the host connected to the ups in question...
    cu
    marc
    Thursday, January 15, 2009 7:44 AM
  • Hi, DrWhoIs007

    According to your description, you want to let the UPS tools to shutdown the VMs and the Hyper-V host automatically if there is a power failure, right?


    In Server Core, I don't think this can be achieve. 
     

    If I misunderstand you concern, please feel free to let me know.

     

     

    Best Regards,

    Vincent Hu

    Thursday, January 15, 2009 8:48 AM
    Moderator
  • hi Vincent,
    yes that's the idea...
    Hyper-V (if the properties of the VM are set right) will shutdown its hosted VM's when the Hyper-V itself is shut down.
    but this shut down should be triggered by the Ups when it is running out of juice...
    i don't mind if the hyper-v itself can't do it but it should defenately be possible to do it with Sc-VMM ...
    i can't imagine that datacenters can't shutdown their hyper-v hosts in case of power failure...
    cu
    marc
    Thursday, January 15, 2009 8:55 AM
  • Uninterruptible Power Supplies (UPSs) can be configured using network connections, USB connections and some solder models through serial connections. When the server running System Center Virtual Machine Manager (SCVMM) is running virtually you can connect to, and manage network connected UPSs. When it's a physical box you can connect to and manage network, USB- and serial connected UPS's (as long as the box offers the right physical connectors and right amount of them) 

    Since HP Uninterruptible Power Supplies (UPSs) are rebranded APC units, you can use the HP or APC software to remotely shutdown the virtual host. When you shutdown a single host running Hyper-V it will pause all guests and shutdown. The APC PowerChute software is especially powerful when you're running a geographically dispersed failover cluster ('geocluster') of Hyper-V servers: You can create Powershell scripts in System Center Virtual Machine Manager (SCVMM) to migrate the virtual guests to the other location (where there's no power outage?) and shut down the guest remotely with the script, triggered by the APC Powerchute software.

    When looking at the PCBE8 compat chart.pdf I noticed APC Powerchute Business Edition software is available for Server Core installations of Windows Server 2008. (both x86 and x64).

    Note:
    When using network connected UPSs, also connect your network components to the UPS. When using a geocluster to perform migrations, make sure every component used in these scenarios are UPS protected. Contact your ISP for information on the protection of components between your locations.

    • Marked as answer by DrWhoIs007 Thursday, January 15, 2009 9:08 AM
    Thursday, January 15, 2009 9:04 AM
  • Hi Sander,
    duh didn't realize that HP bought in by APC
    so probably the APC soft will recognise the ups
    i'll try that, thanks
    this is the best shot so far
    thx
    marc
    Thursday, January 15, 2009 9:08 AM
  • UPS stuff is probably the most frustrating thing I've run across... EVER! We just installed HyperV server and have 4 or 5 VMs running. I can shut down the host manually and all the snapshots are taken and when it starts up again the VMs just start where they left off. How very, very, very sweet is that?!

    Now, if I want to hook up my APC UPS and have it signal the host that the power is off, apparently I can't do that?  All I want is software to monitor the com port, detect the code for 'power is down' and then start a countdown to power off the host. If the com port reports 'power is back' I want another loop that gives it 30 seconds before cancelling the power down. If the UPS goes back to 'power is down' then continue the countdown to power off.

    I could write all this stuff in VB in 30 minutes and I'm beginning to think that's exactly what I will have to do.

    Whatever happened to simple?
    Friday, March 20, 2009 3:22 PM
  • Bob Hawkey said:

    Now, if I want to hook up my APC UPS and have it signal the host that the power is off, apparently I can't do that?
      

    Apparently you misread the information above.
    You can't achive this with Built-in tools, since Microsoft removed the UPS Management feature from Windows Server 2008. You can install the software that came with your APC UPS on Server Core without problems and manage your UPS using that piece of software. You can download the PowerChute software from the APC website as well.

    Bob Hawkey said:

    All I want is software to monitor the com port, detect the code for 'power is down' and then start a countdown to power off the host. If the com port reports 'power is back' I want another loop that gives it 30 seconds before cancelling the power down. If the UPS goes back to 'power is down' then continue the countdown to power off.
      

    The APC sPowerchute oftware that came with your UPS can do that.

    Saturday, March 21, 2009 9:35 AM
  • Hi Bob,
    have you solved the problem with shutting down of Hyper-V Server 2008 by signal from APC UPS?

    Please let me know the software you have used. I´m unsuccessful witn PowerChute Business :(

    BR, Marek
    Tuesday, May 5, 2009 8:45 PM
  • I suppose Hyper-V will be shutdown during normal system shutdown on our setup. We have an APC UPS connected to IBM BladeServer chasis full of blades. Everything is ok when using nonclustered Hyper-V setups, ie. single nodes.

    The problem I see is the following: how can we shutdown an active-active Hyper-V cluster with a couple of HA VMs on each node. When system shutdown is initiated, Hyper-V saves the VMs. Since VMs are in HA, Cluster service immediatly turns them on and then the system is shutdown, resulting in turned off machines and migration nightmare.

    This all becomes even more unmanagable when we need to shutdown all cluster nodes due to power failure being imminent. Any guidelines on this scenario?

    Is there a way to script a 'special shutdown', meaning save state and shutdown the node, in a clustered environment?
    Thursday, May 7, 2009 5:47 PM
  • Regrettably, no, the APC software does not support Server 2008. Insane, I know.
    Thursday, May 7, 2009 5:52 PM
  • Well, I don't really know if I found a solution or not. In the Power settings somewhere it actually sort of seems to behave like a laptop. It shows 'battery power' or something. I have the UPS plugged in but I really haven't had the guts to unplug it to see it the 'battery' level starts to drop. ANyway - there are settings like you'd have on a laptop that will supposedly shut the server down at a certain threshold.

    This may be complete idiocy on my part but why on earth would a big rackmount server have such settings? Very goofy if it isn't what I think it is!
    Thursday, May 7, 2009 5:56 PM
  • Bob - it's not idiocy - I investigated this and everything seemed so promising, but there's a problem (which I'll get to)! 

    I'm running W2k8 Standard x64 full server, which runs Hyper-V and several VMs.  By correct use of Integration Services the VMs gracefully shut down or snapshot when the host OS shuts down.  I recently added a small APC 350 and then became very frustrated with what seems to be lack of support for a pretty basic need - that the host OS shuts down gracefully when the battery runs flat!  Otherwise, why did I buy the thing?

    I noticed that connecting the UPS comm USB cable turns the server into a laptop!  No software, no config - just plug the USB cable and watch the laptop power management icon appear in the systray.  The battery indicator correctly displays the UPS battery charge - just like a laptop.  removing the mains supply obviously switches everything over to battery power and the systray icon correctly reflects this, showing the battery life remaining.

    You can create a new laptop type power plan - with different settings for battery and mains use.  You can set warning and critical battery levels (I chose 50% and 25% respectively in the test), and you can set warning and critical actions - pop-up for warning level - shutdown for critical.  Everything works like a dream.

    The big failure - when the power plan reaches the point of shut down, it should gracefully shut down the host OS, which should wait for the guest VMs to shut down first (as it does if you shut the host manually).  Sadly, what actually happens is not shut down, but 'turn off'.  The host and VMs just die like you pulled the plug.

    This could be really great - just a small spanner in the works and I assume, not by design?  Just give the power plan a graceful shutdown option, and everyone here will be happy I suspect!



    Wednesday, August 19, 2009 10:10 PM
  • I've arrived at the same stalemate, running Hyper-V R2 (core) on an HP ML150 G6 box, currently with SBS2008 on one VM. An APC BX1300G UPS provides about 30 minutes runtime and is connected via USB to my host server. PNP worked flawlessly, detecting the UPS, treating it as a battery.  There's no GUI, but powercfg handily provides access to the same power plan parameters mentioned above. 

     

    Powercfg -setdcvalueindex scheme_balanced sub_battery batlevelcrit  28 (40%)
    Powercfg -setdcvalueindex scheme_balanced sub_battery batactioncrit 3 (shutdown)

    And from powershell, it's possible to monitor UPS state and battery levels...
    PS$ get-wmiobject -class CIM_Battery -namespace "root\CIMV2"


    So when the UPS reaches the critical-battery watermark, the host OS (hyper-V) initiates what seems like a forced shutdown, ("The kernel power manager has initiated a shutdown transition.") and the host powers down within 4-5 seconds. The hypervisor isn't signaled or has time to save VM states, so they're effectively just turned off. Not good.

    Question, is there a way to modifiy the kernel power manager policy to initiate a normal, graceful shutdown instead? 
    Any other ideas?

    I've looked at APC Powerchute Business Edition and don't see my APC model in the support matrix. Not obvious that it would support Hyper-V either.

    Thanks, Mark
    • Proposed as answer by Brian Borg Sunday, October 4, 2009 10:08 PM
    Sunday, October 4, 2009 7:13 PM
  • Mark,

    I don't take credit for creating this solution, but I can tell you I've tested it and now use it on my Hyper-V Server.  It works quite well.  I got this solution from the following thread:
    http://social.technet.microsoft.com/Forums/en/winservergen/thread/10fd4f4a-eba5-4577-8f81-28c1558eb2e7

    I put the following VBScript into local policy as a "machine startup" script on my Hyper-V Server.  The shutdown is graceful.  That is, the hypervisor gets its opportunity to save the states of the VMs prior to powering off.

    set wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
    set batteryColl = wmi.ExecQuery("select * from Win32_Battery")
    set osColl = wmi.ExecQuery("select * from Win32_OperatingSystem")
    
    while true
     for each battery in batteryColl
      battery.Refresh_
      if battery.batteryStatus = 1 and battery.EstimatedChargeRemaining <= 25 then
       for each os in osColl
        os.Win32Shutdown 5
       next
      end if
     next
     wscript.Sleep 15000
    wend
    Ryan
    • Marked as answer by DrWhoIs007 Tuesday, November 3, 2009 2:06 PM
    Tuesday, November 3, 2009 3:20 AM
  • @rwdoyle,
    thx!!!

    gonna try that
    Tuesday, November 3, 2009 2:06 PM
  • Excellent! Will give it a shot. Thanks Ryan.
    Monday, November 23, 2009 12:25 AM
  • Here's what I learned plus a way of sending notifications on loss of power.

    "os.Win32Shutdown 5" (4+1) is a forced shutdown which with a 5GB VM didn't give my hypervisor enough time to save state before the host shut down. Changing the arguement to 1 (normal shutdown) did the trick. So the script looks like this:

    set wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\.\root\cimv2")
    set batteryColl = wmi.ExecQuery("select * from Win32_Battery")
    set osColl = wmi.ExecQuery("select * from Win32_OperatingSystem")

    while true
    for each battery in batteryColl
      battery.Refresh_
      if battery.batteryStatus = 1 and battery.EstimatedChargeRemaining <= 50 then
       for each os in osColl
        os.Win32Shutdown 1
       next
      end if
    next
    wscript.Sleep 15000
    wend



    Notification is always nice, so I cobbled together this powershell script.  Both scripts are fired off at startup via the Task Scheduler.

    UPS_Monitor.ps1 loops forever, checking CIM Battery Class every 60 seconds. On power failure, it sends status updates each minute via SMTP until shutdown, and one email if power is restored before shutdown. 
        
    # Initialize Variables
    # Shutdown threshold at 50% of remaining UPS capacity
    $threshhold = 50
    $interval = 60
    $OnBattery = 0
    $Event = 0

    $hostname = hostname

    # Create SMTP client 
    $Server = "smtp.contoso.com" 
    $Port = 25 
    $Client = New-Object System.Net.Mail.SmtpClient $Server, $Port  
       
    $Client.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials  
       
    $To      = "admin@contoso.com
    $From    = "hyper01@contoso.com

    # Loop on Battery Query
    while (1)
        {
        $bat = get-wmiobject -class CIM_Battery -namespace "root\CIMV2"
            $batstatus = $bat.batterystatus
            $batcapacity = $bat.estimatedchargeremaining
            $timetoshutdown = $bat.estimatedruntime/2
           
            if ($batstatus -eq 1)
                {
                $Event = 1
                $OnBattery = 1
                # "On Battery"
               
                $Subject = "Utility Power Failure: {0} is running On UPS Battery" -f $hostname
                $Body   = "UPS at {0} % remaining capacity, approximately {1} minutes before {2} shutdown." -f $batcapacity, $timetoshutdown, $hostname
               
                if ($batcapacity -lt ($threshhold +5) )
                     {
                     $Body = "Shutdown imminent at {0} %, with " -f $threshhold + $Body 
                     }
               
                }
               
            elseif (($batstatus -eq 2) -and ($OnBattery -eq 1))
                {
                $Event = 1
                $OnBattery = 0
                # "Power Restored"
           
                $Subject = "Utility Power Restored to {0}." -f $hostname
                $Body   = "Battery at {0} % capacity. UPS charging... " -f $batcapacity
                }
               
               
            if ($Event -eq 1) # Create mail message
                {
                $Event = 0
                $Message = New-Object System.Net.Mail.MailMessage $From, $To, $Subject, $Body
                $Message.Priority = [System.Net.Mail.MailPriority]::High
                try { 
                    $Client.Send($Message)
                    # "Message sent successfully"
                    }
                catch {
                    "Exception caught in UPS_Monitor.ps1"
                    }
                }
               
            sleep $interval
        }



    Best, Mark

    Friday, December 4, 2009 5:29 AM
  • I know this is an old thread but I wanted to set the record straight.  I have used both and HP UPS's are most certainly NOT rebranded APC UPS's. 

    From a hardware standpoint HP beats APC in almost every way that matters.  An HP UPS will outlive an APC by 30% – 40% before needing new batteries; the power filtering circuitry is more sophisticated and will alert you to service needs several weeks rather than several days in advance.  Also the construction and servicing is more conducive to making live repairs and battery replacement in a data center.  Within each class the HP ups can support a larger load than the equivalent APC.  The battery reserves are the same so you would need a sidecar battery expansion module to get a good run time reserve but the HP will support more equipment than the APC before overloading.

    Also the single automated shutdown card can do serial shutdown for 4 devices and unlimited network shutdowns downs.  APC you have to choose between the serial shutdown card or the network shutdown card, or buy one of each for their higher end UPSs

    From a software standpoint the story is different APC is still the winner.  Think of the HP as a really good device that an electrical engineer built, but decided to write his own software.  It works and is functional but does not have the features and finish of the APC.  APC has regular software updates and additional advanced monitoring and shutdown features that can be desirable.  Specifically the APC can delay startup until the unit has X minuets of runtime incase if additional power failures.  The HP cannot not so you need to manually calibrate your rune time and account for additional power failures in your runtime target.

    In a nutshell

    HP : Hardware = Great, Software = OK

    APC : Hardware = OK, Software = Pretty Good

    Other people may know more but this is my experience.

    Monday, January 3, 2011 2:50 PM
  • Hi All,

    I am having a little trouble scheduling the Shutdow.vbs script via the Task Scheduler. If I execute the script manually it works perfectly, but when it's started with the Task Scheduler nothing happens.

    In Task Scheduler, it's set to:

    1. Run at System Startup
    2. Run with Highest privileges
    3. Run as Administrator
    4. Configure for Windows 7, Windows Server 2008 R2
    5. Start a program: wscript with arguments (in quotes) "c:\server tools\ups script\ups-shutdown.vbs"

    Did I miss a step in setting up the task? Any help would be much appreciated!

    Saturday, June 18, 2011 8:46 PM
  • Hi All,

    Old question I know, but I do have the answer for those who are still looking!

    Powerchute Business does work! No need for network management card

    We need to exctract the files from pcbesetup.exe, using a "gui" machine, ie win 7 or 2008 machine
    1. Run pcbesetup (i don't have the CD, i downloaded from APC, v9.0.1)
    2. Hit the first "setup" button that comes up. This extratcs the files to User\AppData\Local\Temp\WZSE0.TMP3. (maybe a different temp DIR, search for launch.exe). You may also be able to extract the files from the command line, I didn't bother trying. Leave the install idle while doing this!
    3. Copy the temp dir to a convinient place on your CORE server
    4. Cancel APC setup
    5. From your core command prompt, run BIN\AGENT\SETUP.EXE
    6. Run through the setup. This will install using a gui

    THIS IS ALL YOU NEED TO DO

    7. In any PC that can access your core server (including vm's), you can access the agent from a web browser to configure settings (https://servername:6547), or install the rest of the management software to a machine of your choice. This part is not needed for actual monitor+shutdown. This is only to configure the shutdown settings

    Your done!

    Sit back, relax. Put a smile on your face!

    The truth is out there!!

     

     

    • Proposed as answer by rj3923 Tuesday, July 26, 2011 10:56 PM
    • Unproposed as answer by rj3923 Tuesday, July 26, 2011 10:56 PM
    • Proposed as answer by jason404 Wednesday, April 4, 2012 8:35 PM
    Tuesday, July 26, 2011 10:54 PM
  • Hello rj3923,

    Only one question I would have: Why are you wrote this? - "From your core command prompt, run BIN\AGENT\SETUP.EXE"

    Hyper-V server should be the server of the powerchute agents, shouldn't it? Could you explain what was your idea when you wrote your post?

    supi007

    Sunday, October 23, 2011 2:00 PM
  • Hello Supi007

    Sorry for late reply. Yes you run BIN\AGENT\SETUP.EXE on the hyper-v server core, that is why I say "from your core command prompt". This installs the agent on your hyper-v core server

    Thursday, October 27, 2011 10:59 AM
  • "I am having a little trouble scheduling the Shutdow.vbs script via the Task Scheduler. If I execute the script manually it works perfectly, but when it's started with the Task Scheduler nothing happens."

    Taking a chance that someone is still looking at this old thread. I am having the exact same problem, scripts run fine when run from the command line, but don't work when scheduled with task scheduler. The scripts actually run fine UNTIL I pull then power on the UPS then they stop for some reason and the shutdown script doesn't shutdown the server. The state changes to Ready from Running in the task scheduler. Very strange. I don't see anything in the logs that gives me any clues. 

    -Bill

    Sunday, July 22, 2012 10:28 PM
  • Thanks for this!

    fyi - Ran the setup directly and it worked right off.  Server now protected!

    Sunday, July 29, 2012 6:17 PM
  • I like this solution, but would the detection of "PowerOnline=FALSE" as per the values returned by this command be a better detection of power failure?

    PS C:\> gwmi -Class batterystatus -Namespace root\wmi

    Tuesday, January 1, 2013 1:05 AM
  • Note that APC UPS are American specific.  We used these in Australia and found that there is a very minute but measurable transition from 50Hz to 60Hz when the UPS switches from AC to batteries.  This did not pose a problem under normal circumstances, but our Static Transfer Switches did detect this condition and baulk when transferring the load.  We changed to Eaton Powerware UPS which does not appear to have this issue.  We tried to fix the APC condition unsuccessfully, but maybe there was another setting that could remove this small transition of 50Hz to 60Hz in the APC model.
    Tuesday, January 1, 2013 1:11 AM
  • If you would like to use PowerShell to detect a power outage (monitoring the UPS through WMI)  then here;s a script for you that does exactly that, and allows you to shut down multiple hosts or VM's, and mailing warnings about it: http://www.servercare.nl/Lists/Posts/Post.aspx?ID=102

    Regards, Paul www.servercare.nl

    Wednesday, May 22, 2013 8:05 PM
  • Hi All,

    I am having a little trouble scheduling the Shutdow.vbs script via the Task Scheduler. If I execute the script manually it works perfectly, but when it's started with the Task Scheduler nothing happens.

    In Task Scheduler, it's set to:

    1. Run at System Startup
    2. Run with Highest privileges
    3. Run as Administrator
    4. Configure for Windows 7, Windows Server 2008 R2
    5. Start a program: wscript with arguments (in quotes) "c:\server tools\ups script\ups-shutdown.vbs"

    Did I miss a step in setting up the task? Any help would be much appreciated!

    I really hate to bring up an old thread. However, I'm facing the same issue. I've tried all iterations of running the vbscipt using task scheduler, but can't get it to work. Once the threshold passes, nothing happens even though the task is still in the running state. However, if I manually run the vbscript when I am below threshold the server will shut itself down. HELP?
    • Proposed as answer by rsenio Tuesday, May 6, 2014 10:22 PM
    • Unproposed as answer by rsenio Tuesday, May 6, 2014 10:22 PM
    Tuesday, May 6, 2014 1:20 AM
  • Hi All,

    I am having a little trouble scheduling the Shutdow.vbs script via the Task Scheduler. If I execute the script manually it works perfectly, but when it's started with the Task Scheduler nothing happens.

    In Task Scheduler, it's set to:

    1. Run at System Startup
    2. Run with Highest privileges
    3. Run as Administrator
    4. Configure for Windows 7, Windows Server 2008 R2
    5. Start a program: wscript with arguments (in quotes) "c:\server tools\ups script\ups-shutdown.vbs"

    Did I miss a step in setting up the task? Any help would be much appreciated!

    I really hate to bring up an old thread. However, I'm facing the same issue. I've tried all iterations of running the vbscipt using task scheduler, but can't get it to work. Once the threshold passes, nothing happens even though the task is still in the running state. However, if I manually run the vbscript when I am below threshold the server will shut itself down. HELP?
    Ok, to benefit those that have had the same issue. I discovered when you run your script as a scheduled task, the scheduler will create an account impersonating as the user you configure/specify for the task. The account is always resided in or runs from %systemroot%\system32

    So, what I ended up doing was creating the task as follows.

    Trigger  - at startup
    Actions - Start a program
           Program/Script - C:\Windows\System32\wscript.exe
           Arguments - "C:\servertools\ups-shutdown.vbs"
           Start In - %systemroot%\system32\

    Conditions - only thing checked is start task if on AC power only

    *make sure you remove the checkmark for stopping task when switched to battery power, or the script is useless

    Settings - only thing checked it Allow task to be run on demand

    *make sure to remove option of stopping task if run longer than "x" since the script will need to run forever
    Tuesday, May 6, 2014 10:22 PM
  • Nice work :)
    Wednesday, September 27, 2017 9:53 AM