Kaseya Community

Execute Shell Command Failing

  • I recently upgraded our 8.0 VSA to 9.1 and now have a particular script failing that used to work fine. It fails on the following Procedure step (which is Line 2 - or Line 3 if I impersonateUser before this step):

    executeShellCommandToVariable("Date /T", System, "All Operating Systems", "Halt On Fail")

    I've also tried an "impersonate user" before this step but with the same results. The failure message I get states:

    "FAILED to create THEN step 1, Unknown Command Id 444. Error = Invalid Message Identifier (Line 2) "

    Can someone help me resolve this issue, please?



    Synatx correction.
    [edited by: zippo at 10:31 AM (GMT -7) on Oct 28, 2015]
  • Hi Zippo;

    Whenever you see the "Unknown Command" error on your agent procedures after an upgrade run the "Reapply Schema", sometimes you have to run it multiple times before it fixes the issue.

  • Shoot! Good idea, HardKnoX. I'll give that a try.

  • That fixed it, HardKnoX. Thank you for your time and assistance!

  • No problem Smile

  • We had the same problem going from 9.1 to 9.2, except it happened on most procedures. The schema reply resolved our issues.

  • HardKnoX! You are a champ! I have struggled with scripting in Kaseya for ages, almost going insane thinking MY logic was wrong. (I should have had more faith in myself!)

    Re applying the Schema 2 times magically made all these scripts I thought were duds suddenly come alive! Thank you for that little gem.

  • If you want to fix that agent procedure problem without downtime for VSA then you can execute this query in SSMS: Kaseya\DBInstall\AgentProcedures\script\loadsubAgentProcs.sql

    Reapply Schema also runs that but sometimes it timeouts.

  • neuvoja
    If you want to fix that agent procedure problem without downtime for VSA then you can execute this query in SSMS: Kaseya\DBInstall\AgentProcedures\script\loadsubAgentProcs.sql

    Thank you!  Much faster!  Smile