Kaseya Community

Scripting KAM through Agent Procedure

  • I'm trying to write a comprehensive malware removal script using a set of agent procedures.

    The big hole in my plan right now is the ability to script the installation of KAM on to a remote machine and then run a scan.

    We have the KAM module, we use it on many machines by deploying through the VSA GUI, but I would really like to be able to do it all with a procedure, and keep the VSA integration.


    Any thoughts or recommendations? I think I've looked at every post in here....


    UPDATE: 12 days and nothing... either that 's a really bad question or it can't be done! :) To be clear: we have a pool of KAM licenses that we deploy (and keep resident) on problem machines. I want to script the KAM actions. I can easily do it with the non-integrated MBAM...

    [edited by: Kerry at 12:07 AM (GMT -7) on 3-28-2012] No response to my original post. Bump.
  • I'd like to know this too... seems like a pretty reasonable request to be able to deploy KAM to machines as part of an onboarding procedure (or agent procedure in general) - isn't Kaseya all about automation? Why make modules that cannot be automated?

    Anyway.. maybe we can get this discussion started again. I've been having a good look at how Kaseya installs MBAM and it isn't pretty!

    Jump on your SQL server and run this;

    USE ksubscribers


    SELECT * FROM scriptIdTab where scriptName like 'KAM: %'

    You'll see that Kaseya are creating a script for Install, Get Install Log, Uninstall, Get Uninstall Log, Get Scheduled Scan Results etc for each and every agent!

    Viewing the contents of one of these scripts shows us Kaseya is using 2 unique variables;



    You can see this if you run this query (Where XXXXX is the scriptID from one of the scripts returned from the above SQL statement)

    USE ksubscribers


    SELECT * FROM scriptThenElse

    WHERE scriptId = 'XXXXXXX'

    ORDER BY stepNumber

    Now #correlationId# and #params# are variable constants, defined inside the script! Why oh why arent these stored in a table or against the agent someplace else. That is the point of a database after all.

    I tried running the install script 'KAM: Install' (scriptID: 901) via an agent procedure and manually specifying the profile name as a constant - The install works fine, however it does not link up in the GUI.

    At this point I gave up. This module needs a serious database structure rethink before automating the install is going to be possible *sigh*