Nhãn hiệu của chúng tôi

Impact-Company-Logo-English Black-01-177x54

Chào mừng bạn đến với Trang web của Schneider Electric

Chào mừng đến với trang web của chúng tôi.
		
Hôm nay chúng tôi có thể giúp gì cho bạn?
How to trigger a PowerShell script using PowerChute Network Shutdown?

Article available in these languages: Tiếng Tây Ban Nha, Tiếng Pháp

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 update the path to PowerShell.exe and modify the path to MyPowerShellScript.ps1. Also, all command files and script PowerChute Network Shutdown 4.4.x and above 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 modify the account settings to enable 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. For example, if you try to launch Notepad, it will fail. In earlier versions of Windows, all services ran 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 an .exe, that .exe will be launched in Session 0 and will not be visible to 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 found at http://blogs.technet.com/b/askperf/archive/2007/04/27/application-compatibility-session-0-isolation.aspx

Schneider Electric Việt Nam

Tìm hiểu thêm
Phạm vi:
Tìm hiểu thêm
Phạm vi:
  • Tài liệu về Sản phẩm
  • Tải xuống phần mềm
  • Công cụ chọn Sản phẩm
  • Thay thế và thay đổi sản phẩm
  • Trung tâm Hỗ trợ
  • Tìm Văn phòng của chúng tôi
  • Nhận báo giá
  • Tìm Nhà Phân phối
  • Cộng đồng Schneider Electric
  • Cơ hội nghề nghiệp
  • Hồ sơ doanh nghiệp
  • Báo cáo hành vi sai trái
  • Khả năng truy cập
  • Phòng tin tức
  • Nhà đầu tư
  • EcoStruxure
  • Tìm việc
  • Blog
  • Chính sách bảo mật
  • Thông báo về Cookie
  • Điều khoản sử dụng
  • Change your cookie settings