Unable to fire command (or file) when a service crashes/fails.
I have a script that I can run manually that emails me event logs that match search criteria. When I set said service to run a program using the following parameters:
Program:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Command line Parameter:
-ExecutionPolicy Bypass -File C:\PowerShell_Scripts\tftp_restarttftpd_restart.ps1
I've also tried just echoing some text to a file as well as send-mailmessage in Command Line Parameter. I've also used the -Command
suffix. None work.
I trigger the service failure buy capturing the PID and running taskkill against it. I see the service fail but no email triggers.
I've looked for events to indicate the script was at least attempted but I don't see anything.
Help appreciated.