I tried to open a ticket with Kaseya support to point out that this is broken - but that has proven to be a waste of time (as usual)...

If you use the quick launch - (as I have 15 support personal that this is all they have access to) - then you need to know that the code below is incorrect.  It should not be deleting ALL rows where the scriptid and schedtype match - but only the rows for the agentGuid that you are working with (as I have also listed below).

If you use the quick launch on an agent to run a job - it deletes ALL entries in the scriptAssignment table without regard to the specific agent that you are working with.

In toolbox\agentDash.asp

Line 348 reads

if ((Number(runNowId) > 0)&&(runNowPrompt.length == 0)) {

    batchCmd = "DELETE FROM scriptAssignment WHERE scriptId="+runNowId+" AND schedType=2; "+

        "INSERT INTO scriptAssignment (scriptId,agentGuid,runCount,logLevel,execPeriod,"+

        "execScriptTime,runAtTime,monthPeriod,actionAdmin,schedType) VALUES "+

        "("+runNowId+","+agentGuid+",1,0,100,CURRENT_TIMESTAMP,0,0,N'"+sessionAdmin+"',2); "



and it should read

if ((Number(runNowId) > 0)&&(runNowPrompt.length == 0)) {

    batchCmd = "DELETE FROM scriptAssignment WHERE scriptId="+runNowId+" AND schedType=2 AND agentguid="+agentGuid+"; "+

        "INSERT INTO scriptAssignment (scriptId,agentGuid,runCount,logLevel,execPeriod,"+

        "execScriptTime,runAtTime,monthPeriod,actionAdmin,schedType) VALUES "+

        "("+runNowId+","+agentGuid+",1,0,100,CURRENT_TIMESTAMP,0,0,N'"+sessionAdmin+"',2); "