APC UPS for Home and Office Forum
Support forum to share knowledge about installation and configuration of APC offers including Home Office UPS, Surge Protectors, UTS, software and services.
Posted: 2021-06-29 06:24 PM . Last Modified: 2024-03-21 03:44 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:24 PM . Last Modified: 2024-03-21 03:44 AM
Team,
My goal is to be able to script automatic shutdowns using the command file setting option found in the PowerChute Business Edition. Unfortunately (hence the post), I've not gotten this to work correctly.
I'm using Windows 2003 Enterprise Edition (64 bit) with PowerChute Business Edition 7.05 (agent, server, console, connected directly to UPS). I've created two test files (see below) that are both located in the \cmdfiles directory. The first file is a *.cmd file which initiates a *.bat file. Triggering either of these files outside of the APC software initiates the desired action. However, the files do not function as desired when the file is selected and I click on "Test" on the "Configure Shutdown Sequence" screen. Both APC services are logging on with an account that has been given domain admin privileges (heightened privileges to help rule out permissions issues). I do believe that the syntax of both files indicated below is correct. Obviously I have a rather simple batch file at the moment as I want to get it to work correctly before adding any additional variables.
Thanks in advance for your input, thoughts, and ideas.
Colin M. McGroarty
PowerOut.cmd (C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles)_
@echo off
rem
rem Maximize for best viewing
rem This command file provides examples of proper command file syntax
rem
rem Command Files run by PowerChute Business Edition must be placed in this directory.
rem
rem Use the full path name of executable programs and external command files.
rem
rem The @START command must be used to run executable programs (see example below).
rem For the @START command, path names that include spaces must be enclosed in quotes;
rem arguments for the executable must be outside the quotes. A double quote must
rem precede the quoted path name. For example, to execute a command file in
rem c:\Program Files\APC\PowerChute Business Edition\agent\cmdfiles called myShut.exe,
rem the following line should be entered in the command file:
rem
rem @START "" "c:\Program Files\APC\PowerChute Business Edition\agent\cmdfiles\myShut.exe"
rem
@echo on
@START "" "C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles\PowerOut.bat"
PowerOut.bat (C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles)*
C:\WINDOWS\system32\shutdown /s /m \ \apps-01.mcgroarty.net /t 360
Note: Space in above line (\ \) inserted deliberately due to newsgroup formatting
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:43 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:43 AM
Thanks for the input. This tells me that the domain admin account I'm using should suffice and tells me that I do not have an error with the script.
Does anyone have any additional thoughts? I'm assuming such scripting has to be pretty commonplace and would like to hear if anyone else is having any success using this method to shutdown remote systems.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:24 PM . Last Modified: 2024-03-21 03:44 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:24 PM . Last Modified: 2024-03-21 03:44 AM
Hi Guys,
I'm trying to shutdown a mac server using putty and ad the following command
@START "" "C:\windows\putty.exe" -ssh macserver -l root -pw xxx -m c:\shutdownmac.sh
I typed the command in the default.cmd file and did a test .. it doesn't do anything.However when I manually double click on the file it shutdown the mac server.So, putty is working so the command. I've tested a simple command mkdir it works so APC is actually executing the comamnd file. I guess either my syntax is incorrect for APC to understand or something going on.
I've even tried this @START "" "C:\windows\putty.exe" -ssh macserver -l root -pw xxx -m "c:\shutdownmac.sh"
shutdowmac.sh simply contain the following code
shutdown -r now
I'm running windows 2003 server. I tried every thing mentioned in this forum..even google.
Any help will be great
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Thank guys. It's working now 🙂
All I had to do is change login as Domain Administrator under login properties of APC PBE Agent services
And the following code I used
START "" "C:\windows\putty.exe" -ssh macserver -l root -pw xxx -m c:\shutdownmac.sh
Thanks again.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Team,
My goal is to be able to script automatic shutdowns using the command file setting option found in the PowerChute Business Edition. Unfortunately (hence the post), I've not gotten this to work correctly.
I'm using Windows 2003 Enterprise Edition (64 bit) with PowerChute Business Edition 7.05 (agent, server, console, connected directly to UPS). I've created two test files (see below) that are both located in the \cmdfiles directory. The first file is a *.cmd file which initiates a *.bat file. Triggering either of these files outside of the APC software initiates the desired action. However, the files do not function as desired when the file is selected and I click on "Test" on the "Configure Shutdown Sequence" screen. Both APC services are logging on with an account that has been given domain admin privileges (heightened privileges to help rule out permissions issues). I do believe that the syntax of both files indicated below is correct. Obviously I have a rather simple batch file at the moment as I want to get it to work correctly before adding any additional variables.
Thanks in advance for your input, thoughts, and ideas.
Colin M. McGroarty
PowerOut.cmd (C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles)_
@echo off
rem
rem Maximize for best viewing
rem This command file provides examples of proper command file syntax
rem
rem Command Files run by PowerChute Business Edition must be placed in this directory.
rem
rem Use the full path name of executable programs and external command files.
rem
rem The @START command must be used to run executable programs (see example below).
rem For the @START command, path names that include spaces must be enclosed in quotes;
rem arguments for the executable must be outside the quotes. A double quote must
rem precede the quoted path name. For example, to execute a command file in
rem c:\Program Files\APC\PowerChute Business Edition\agent\cmdfiles called myShut.exe,
rem the following line should be entered in the command file:
rem
rem @START "" "c:\Program Files\APC\PowerChute Business Edition\agent\cmdfiles\myShut.exe"
rem
@echo on
@START "" "C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles\PowerOut.bat"
PowerOut.bat (C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles)*
C:\WINDOWS\system32\shutdown /s /m \ \apps-01.mcgroarty.net /t 360
Note: Space in above line (\ \) inserted deliberately due to newsgroup formatting
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Right click the PowerChute Business Edition Agent service, and check the "allow this service to interact with the desktop" box in the Logon tab, and try your test again. Any change in the results? If you are still having trouble with your script, try something even simpler like creating a directory or something - just to make sure that PowerChute is atleast attempting to run the script.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:44 AM
Thank you for the superfast reply.
I can use the APC tool successfully in conjunction with super simple commands, create file for example. Changing the service account from a named account to local service with desktop interaction did not however solve the issue.
Kind Regards,
Colin M. McGroarty
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:43 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-29 06:25 PM . Last Modified: 2024-03-21 03:43 AM
Thanks for the input. This tells me that the domain admin account I'm using should suffice and tells me that I do not have an error with the script.
Does anyone have any additional thoughts? I'm assuming such scripting has to be pretty commonplace and would like to hear if anyone else is having any success using this method to shutdown remote systems.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.