Kaseya Community

Remove Kaseya Agent After One Week

  • I have a few customers that are break-fix customers, and we use the Kaseya Agent as temporary remote-control agents while we fix problems. However, my technicians have a hard time uninstalling the agents when they are finished, so I'd like to associate an uninstall script seven days after the agent first checks in.

    I have a template for the 'temporary remote client', and I have an uninstall script, but I don't know how to schedule it seven days after the agent's first check-in.

    Any ideas?

    Legacy Forum Name: Remove Kaseya Agent After One Week,
    Legacy Posted By Username: Rocky
  • I would create another script that uses the step Schedule Script for this purpose. (Is that wording confusing?)

    Create a script called "Schedule Uninstall Script" and set just 1 step to schedule your "Uninstall Script" for 7 days out.

    In your template schedule your "Schedule Uninstall Script" to run on the first check-in.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: CCDave
  • OK I've been trolling through K2 to figure how they uninstall the agent from the delete agent procedure. They effectively run this command #agentPath#\KASetup.exe /r /s /g #agentInst# /l %temp%\kasetup.log now scripting is not a strong area of mine. This procedure is written on the fly by K2 when you click the button. #agentpath# is just a variable you create based on the install path of the agent, I'm having trouble figuring what #agentinst# is though it is generated by this piece of code i THINK

    <scriptIf ifFunc="1" fp1="" fp2="" fp3="" ifTest="1" testVal="" scriptType="-2" description="Uninstall agent based on the agent instance GUID." />
        <scriptThenElse teType="0" stepNum="1" teFunc="26" fp1="2" fp2="legacy" fp3="agentInst" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="2" teFunc="26" fp1="14" fp2="" fp3="agentInst" osType="0" contOnFail="1" />
        <scriptThenElse teType="0" stepNum="3" teFunc="1" fp1="306" fp2="" fp3="0" osType="0" contOnFail="0" />
    I can't quite follow what variables it is retrieving however. Any of you script gurus able to decipher this? EDIT: OK sussed it out. the AgentInst is the GUID of your K2 install

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: HTG

    [edited by: Brendan Cosgrove at 5:19 PM (GMT -8) on 12-17-2010] .