Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84631members
353954posts

Script against PowerChute Personal Edition?

APC UPS Data Center & Enterprise Solutions Forum

Schneider Electric support forum for our Data Center and Business Power UPS, UPS Accessories, Software, Services, and associated commercial products designed to share knowledge, installation, and configuration.

Solved
mukti_apc
Crewman
Crewman
0 Likes
2
567

Script against PowerChute Personal Edition?

This was originally posted on APC forums on 10/28/2012


I just purchased a Back-UPS (BE750G) and installed PowerChute Personal Edition. Is there any way I can pull information from PowerChute via a script? Does PowerChute write the the Windows event log? I was thinking about writing a powershell script to email me when it goes on battery power. I'm not sure if the UPS beep will wake me up if I'm asleep, and I won't receive a notification if I'm away from my home office. Is there a WMI object I can access since the battery is connected via USB? I'm really looking for any way to get battery/power status for scripting. Thanks!


Accepted Solutions
wclemens_apc
Crewman
Crewman
0 Likes
0
567

Re: Script against PowerChute Personal Edition?

This was originally posted on APC forums on 12/10/2012


I have set up email notification for UPS events triggered by entries that PowerChute Personal Edition writes in the Event Log.
All information below is based on my implementation on Windows 7 Professional. I expect it works on other Windows 7 versions but I have not tested it on anything else.
The following UPS-related events are the ones I use to trigger email alerts:
Application Log / Event ID 174 (Battery backup transferred to battery power due to a blackout.)
Application Log / Event ID 61455 (Battery backup transferred to AC utility power.)
System Log / Event ID 13 (The operating system is shutting down at system time ?2012?-?12?-?10T22:09:22.256932100Z.) - the email may or may not get sent out for this event,
depending on the timing of shutting down the SMTP server used to relay the email.

Open Event Viewer and locate an instance of the Event ID for which you want to send an email notification. You may need to remove AC power from your UPS input to generate Events 174 and 61455 if you don't already have any instances in your Event Log. Right-click on the event and select "Attach task to this event."
Add a description if you wish and click Next, then Next again.
Click the button for "Send an e-mail" and click Next.
Fill out the From, To, Subject, and SMTP Server. I send from myself to myself and put a brief description of the event (i.e., Computer on Battery) in the subject and leave the message field blank.
For SMTP server, enter 127.0.0.1 to use a local SMTP relay server.
Mke sure the box is checked to "Open the properties dialog for this task when I click Finish," then click Finish.
On the General tab I have clicked on the button to Run whether user is logged on or not and ticked the box to Run with highest priveleges. (My account is an admin acct.)
On the Conditions tab I have unchecked the box to Start the task only if the computer is idle ... and Start the task only if the computer is on AC power.
On the Settings tab I have checked Allow task to be run on demand (so I can easily test it), Stop the task if it runs longer than [1 hour, the minimum], and If the running task
does not end when requested, force it to stop, I have unchecked all the other boxes.

If you already have an SMTP relay server running, you are done. If you don't have one, you can download one free here:
http://www.windows7download.com/win7-free-smtp-server/dxnrjvpv.html
Note: This Free SMTP Server does not run as a service. It must be started in order to relay email messages. I put a shortcut for it into my Startup folder and start it minimized.

I hope this information may be of use to someone else.

See Answer In Context

2 Replies 2
BillP
Administrator Administrator
Administrator
0 Likes
0
567

Re: Script against PowerChute Personal Edition?

This reply was originally posted by Angela on APC forums on 10/29/2012


i locked your other thread since it was a duplicate and this one is located in the correct spot.

we can refer to it here: Referenced content removed

wclemens_apc
Crewman
Crewman
0 Likes
0
568

Re: Script against PowerChute Personal Edition?

This was originally posted on APC forums on 12/10/2012


I have set up email notification for UPS events triggered by entries that PowerChute Personal Edition writes in the Event Log.
All information below is based on my implementation on Windows 7 Professional. I expect it works on other Windows 7 versions but I have not tested it on anything else.
The following UPS-related events are the ones I use to trigger email alerts:
Application Log / Event ID 174 (Battery backup transferred to battery power due to a blackout.)
Application Log / Event ID 61455 (Battery backup transferred to AC utility power.)
System Log / Event ID 13 (The operating system is shutting down at system time ?2012?-?12?-?10T22:09:22.256932100Z.) - the email may or may not get sent out for this event,
depending on the timing of shutting down the SMTP server used to relay the email.

Open Event Viewer and locate an instance of the Event ID for which you want to send an email notification. You may need to remove AC power from your UPS input to generate Events 174 and 61455 if you don't already have any instances in your Event Log. Right-click on the event and select "Attach task to this event."
Add a description if you wish and click Next, then Next again.
Click the button for "Send an e-mail" and click Next.
Fill out the From, To, Subject, and SMTP Server. I send from myself to myself and put a brief description of the event (i.e., Computer on Battery) in the subject and leave the message field blank.
For SMTP server, enter 127.0.0.1 to use a local SMTP relay server.
Mke sure the box is checked to "Open the properties dialog for this task when I click Finish," then click Finish.
On the General tab I have clicked on the button to Run whether user is logged on or not and ticked the box to Run with highest priveleges. (My account is an admin acct.)
On the Conditions tab I have unchecked the box to Start the task only if the computer is idle ... and Start the task only if the computer is on AC power.
On the Settings tab I have checked Allow task to be run on demand (so I can easily test it), Stop the task if it runs longer than [1 hour, the minimum], and If the running task
does not end when requested, force it to stop, I have unchecked all the other boxes.

If you already have an SMTP relay server running, you are done. If you don't have one, you can download one free here:
http://www.windows7download.com/win7-free-smtp-server/dxnrjvpv.html
Note: This Free SMTP Server does not run as a service. It must be started in order to relay email messages. I put a shortcut for it into my Startup folder and start it minimized.

I hope this information may be of use to someone else.