I'm trying to execute a powershell script (.ps1 file) as an alert trigger action. I know the trigger condition is met because other actions (such as sending an email notification are working). I added a powershell script with the execute an external program, but it is not running. I tried several different options but they all fail:
powershell d:\script.ps1
powershell -noprofile -executionpolicy bypass d:\script.ps1
powershell -command "& 'd:\script.ps1"
%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe .... etc
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe ... etc
The alert service runs as the local sytsem account. The powershell script does not call any Windows based remote devices so Windows security is not an issue. I can run the script fine from the command line as a local administrator or as the local sytsem account (I can load this user by using PSEXEC.EXE -HSI).
Any suggestions?