0 Replies Latest reply on Mar 9, 2018 11:08 AM by simpltek

    SQL query in PowerShell script Trigger Action is not returning a value when triggered by SW, but it DOES when you run the script on the SW application server itself

    simpltek

      The submit a ticket portal was not working, kept giving me a "Your ticket was unable to be submitted at this time due to an error. Please try again. We apologize for any inconvenience." error and would never submit, soooo....

       

      The attached script is triggered by an alert in SW. Testing the trigger produces a text file, which it's supposed to do. However, for some reason, a part of the text file is supposed to include a TeamID value, and it never does. I've spent the better part of about a week trying to figure out why this one part of the PowerShell script (line 16) is not returning a value when triggered by SW, but it DOES when you run the script on our SW application server itself.

       

      The trigger action ("Execute an external program") command is the following:

      • powershell E:\Scripts\TicketCreator\CreateCherwellEvent1.ps1 -team 'NOC'

       

      So, the trigger does run the PS script, but for some reason it's not executing the SQL query, but only if you run it through SW; works perfectly in a regular PowerShell window on the app server.

       

      Please help