Our Brands

Welcome to the Schneider Electric Website

Welcome to our website.
		
How can we help you today?
How to trigger a PowerShell script using PowerChute Network Shutdown?
Issue:
Would like PowerChute Network Shutdown to trigger a Windows executable.

Product:
PowerChute Network Shutdown

Environment:
All supported Windows OS running PowerChute Network Shutdown version 4.4.x and above.

Solution:

To run a Windows PowerShell script from PowerChute, you must create two scripts: a .bat or .cmd file and a PowerShell script .ps1. We recommend using Notepad ++ to avoid saving the files as .txt in Notepad or Wordpad.

PowerChute will run a .bat, so we created Trigger.bat. That file consists of
"%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Unrestricted -NoProfile -NonInteractive C:'\Temp\MyPowerShellScript.ps1'

You will need to verify or change the path to powershell.exe and change the path to the MyPowerShellScript.ps1. Also, all command files and script PowerChute Network Shutdown 4.4.x and above will run must be stored in

C:\Program Files\APC\PowerChute\user_files for Windows systems

/opt/APC/PowerChute/user_files/ for Linux systems

The second file is the .ps1 file. In the example below, we had PowerShell trigger my.exe

Start-Process "C:\Program Files\my.exe"

You will need to verify or change the path to the .exe

The command file runs using the local system account. You may need to change the account to allow the script to run. To change the account, go to Control Panel—Administrative Tools—Services. In the example below, the user has been changed to wkadmin.
PowerChute Services

NOTE: PowerChute cannot execute programs that require interaction with the desktop; only command line-enabled programs are supported, e.g., if you try to launch Notepad, it will fail. In earlier versions of Windows, all services run in Session 0 along with applications. This situation poses a security risk. In Windows Vista and later versions of Windows, the operating system isolates services in Session 0 and runs applications in other sessions. PowerChute is run in Session 0, so if a command file launches a .exe, that .exe will be launched in Session 0 and not visible to the logged-in users. To verify that the .exe has launched, open Task Manager and review the list of Processes running. More information on Windows Session can be foundat http://blogs.technet.com/b/askperf/archive/2007/04/27/application-compatibility-session-0-isolation.aspx

Schneider Electric Hong Kong

Explore more
Range:
Users group

Discuss this topic with experts

Visit our Community for first-hand insights from experts and peers on this topic and more.
Explore more
Range:

Need help?

  • Start here!

    Find answers now. Search for a solution on your own, or connect with one of our experts.

  • Contact Support

    Reach out to our customer care team to receive more information, technical support, assistance with complaints and more.

  • Where to buy?

    Easily find the nearest Schneider Electric distributor in your location.

  • Search FAQs

    Search topic-related frequently asked questions to find answers you need.

  • Contact Sales

    Start your sales enquiry online and an expert will connect with you.

I'd like to receive news and commercial info from Schneider Electric and its affiliates via electronic communication means such as email, and I agree to the collection of information on the opening and clicks on these emails (using invisible pixels in the images), to measure performance of Schneider Electric's communications and to improve them. For more details, please read our Privacy Policy.

  • Products Documentation
  • Software Downloads
  • Product Selector
  • Product Substitution and Replacement
  • Help and Contact centre
  • Find our Offices
  • Get a Quote
  • Where to buy
  • Careers
  • Company Profile
  • Report a misconduct
  • Accessibility
  • Newsroom
  • Investors
  • EcoStruxure
  • Job Search
  • Blog
  • Privacy Policy
  • Cookie Notice
  • Terms of use
  • Change your cookie settings
Your browser is out of date and has known security issues.

It also may not display all features of this website or other websites.

Please upgrade your browser to access all of the features of this website.

Latest version for Google Chrome, Mozilla Firefox or Microsoft Edgeis recommended for optimal functionality.