Kaseya Community

Script to run the 'latest audit' system script

This question is answered

I have a procedure created and want to schedule the system script 'latest audit' at the end, but it does not appear in the schedule procedure list.

 

How can I create a separate script to the same as the latest audit, so i can schedule it to run?

Any help will be greatly appreciated.



[edited by: mike.brown at 10:32 AM (GMT -7) on 28 Aug 2012] *
Verified Answer
  • Procedure Audits - Run Manually via Script.xml

    Try this procedure. ( I haven;t tested it , but pretty sure it works )

    Upload it to your VSA .. it will run Script ID 136 which is the script ID for Latest Audit.

    Don't try and edit the script thought as it will not save .. you need to export it , then edit the XML , then re-import it to make any changes

    Script IDs for other audits are :

    Update Lists By Scan = 199
    Baseline Audit = 135
    Latest Audit = 136
    SW License Audit = 138
    
    
    Regards
    Paul
  • Capture.JPG

    This is the result after running the script

    So it seems to work and also calls the other parts of the audit i.e. SW Audit , Add Remove Programs etc )

    Regards

    Paul

All Replies
  • What you're asking isn't possible exactly how you describe. You will instead need to schedule the Latest Audit from the Audit page after the script is scheduled.

  • I found the below in the systemscripts.xml but I am not sure how to import it as a new procedure

    -<scriptDef name="Latest Audit" id="136"> <scriptIf description="Audit selected machines. Schedule this script on a recurring basis to always capture the latest information on each machine." scriptType="-2" testVal="" ifTest="1" fp3="" fp2="" fp1="" ifFunc="1"/> <scriptThenElse fp3="" fp2="*.exe" fp1="0" contOnFail="0" osType="0" teFunc="19" stepNum="1" teType="0"/> <scriptThenElse fp3="1" fp2="0.1" fp1="138" contOnFail="1" osType="13" teFunc="1" stepNum="2" teType="0"/> <scriptThenElse fp3="1" fp2="0.1" fp1="200" contOnFail="1" osType="13" teFunc="1" stepNum="3" teType="0"/> <scriptThenElse fp3="msg+++SQLCMD:IF EXISTS(SELECT scriptId FROM scriptIdTab WHERE scriptId = 1307) BEGIN INSERT INTO scriptAssignment (scriptId,agentGuid,runCount,logLevel,execPeriod,execScriptTime,runAtTime,monthPeriod,actionAdmin) VALUES(1307, #vMachine.agentGuid#, 1, 0, 0, CURRENT_TIMESTAMP, 0, 0, NULL) END" fp2="0" fp1="2" contOnFail="1" osType="13" teFunc="26" stepNum="4" teType="0"/> <scriptThenElse fp3="" fp2="VSAHiddenFiles\readme.txt" fp1="#users.agentTempDir#\readme.txt" contOnFail="1" osType="13" teFunc="5" stepNum="5" teType="0"/> <scriptThenElse fp3="" fp2="" fp1="#users.agentTempDir#\readme.txt" contOnFail="1" osType="13" teFunc="3" stepNum="6" teType="0"/> <scriptThenElse fp3="" fp2="VSAHiddenFiles\readme.txt" fp1="#users.agentTempDir#/readme.txt" contOnFail="1" osType="12" teFunc="5" stepNum="7" teType="0"/> <scriptThenElse fp3="" fp2="" fp1="#users.agentTempDir#/readme.txt" contOnFail="1" osType="12" teFunc="3" stepNum="8" teType="0"/> <scriptThenElse fp3="" fp2="VSAHiddenFiles\readme.txt" fp1="#users.agentTempDir#/readme.txt" contOnFail="1" osType="16" teFunc="5" stepNum="9" teType="0"/> <scriptThenElse fp3="" fp2="" fp1="#users.agentTempDir#/readme.txt" contOnFail="1" osType="16" teFunc="3" stepNum="10" teType="0"/> </scriptDef>

  • You can't with the current version of Kaseya.

  • Oh, ok.

    thanks

  • Procedure Audits - Run Manually via Script.xml

    Try this procedure. ( I haven;t tested it , but pretty sure it works )

    Upload it to your VSA .. it will run Script ID 136 which is the script ID for Latest Audit.

    Don't try and edit the script thought as it will not save .. you need to export it , then edit the XML , then re-import it to make any changes

    Script IDs for other audits are :

    Update Lists By Scan = 199
    Baseline Audit = 135
    Latest Audit = 136
    SW License Audit = 138
    
    
    Regards
    Paul
  • Interesting workaround. Thanks for sharing that.

  • Capture.JPG

    This is the result after running the script

    So it seems to work and also calls the other parts of the audit i.e. SW Audit , Add Remove Programs etc )

    Regards

    Paul

  • Thanks!

    That is exactly what I needed, worked perfectly!

    Regards Mike