Launch powershell scripts from events

Answered

Comments

4 comments

  • Avatar
    Jeff Scott

    Hey Andrew,

     

    We may want to open a ticket for this issue in case we need to troubleshoot further, but the first thing you will want to check is that the Cerberus Service in windows has permission to execute the script.  If so, and it still cannot run, please let us know and I will generate a ticket from here.

     

    Jeff

    0
    Comment actions Permalink
  • Avatar
    andrew rivard

    Thanks Jeff. I'll meet with our IT team later today to investigate those permissions

    In the mean time, can you tell me which of those methods for launching scripts that I tried should have been expected to work?

    After we adjust the permissions I want to make sure we run the correct test.

    0
    Comment actions Permalink
  • Avatar
    Jeff Scott

    Hey Andrew,

     

    You are welcome.  Everything looks set up correctly. The event target points to C:\windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exeThe command is pointing to the PS1 file C:\ftproot\freespace.ps1. I would recommend that you test your script in Powershell. You may consider using https://www.scalyr.com/blog/getting-started-quickly-powershell-logging/ for logging purposes. This will help you troubleshoot any issues you run into.

    0
    Comment actions Permalink
  • Avatar
    andrew rivard

    The script runs fine manually and the service is running under my user so it should have the same permissions. 

    My IT team pointed me to this article which which shows a similar issue in an unrelated situation:
    https://social.technet.microsoft.com/Forums/windows/en-US/65d5cf66-2d91-44ee-ada6-f7530897e42b/deploying-powershell-scripts-exit-code-1?forum=configmanagerapps

    Adding -ExecutionPolicy ByPass to the command arguments fixed the problem.

    0
    Comment actions Permalink

Please sign in to leave a comment.