Kaseya Community

Audit Customization

  • Hello. I'm looking for a way to customize an audit to find some files?

    We are looking for a way in Kaseya to do an audit on the system to look for some specific files that have to do with a certain software. These files have the .cache on the end, and in Kaseya, I have not found them. Is there a way to create a custom scan to find these files?

    Thank you.

    Legacy Forum Name: Audit Customization,
    Legacy Posted By Username: gunco5
  • We've covered this before in other threads but heres mine



    Part 1, dont forget to change the file extentions in step2



    Script Name: Search Unwanted Files on PC 1-2

    Script Description: Search for all . MP3, .AVI, .MPG, .MPEG, .DIVX, files on your system



    IF True

    THEN

    Get Variable

    Parameter 1 : 10

    Parameter 2 :

    Parameter 3 : AgentTemp

    OS Type : 0

    Write Script Log Entry

    Parameter 1 : Search for unwanted files started.

    OS Type : 0

    Execute Shell Command

    Parameter 1 : for %a in (C D E) do if exist %a:* for %b in (mp3 avi mp4 m4a m4p divx) do dir %a:\*.%b /s /a /b>>>>"#AgentTemp#"\files.txt

    Parameter 2 : 1

    OS Type : 0

    Execute Shell Command

    Parameter 1 : type #AgentTemp#\files.txt|find /c ":" >>"#AgentTemp#"\files.count

    Parameter 2 : 1

    OS Type : 0

    Get Variable

    Parameter 1 : 1

    Parameter 2 : #AgentTemp#\files.count

    Parameter 3 : files

    OS Type : 0

    Write Script Log Entry

    Parameter 1 : Number of unwanted files found: #files#

    OS Type : 0

    Execute Script

    Parameter 1 : Search Unwanted Files on PC 2-2 (NOTE: Script reference is NOT imported. Correct manually in script editor.

    Parameter 2 :

    Parameter 3 : 0

    OS Type : 0

    Get File

    Parameter 1 : #AgentTemp#\files.txt

    Parameter 2 : FileSearch\UnwantedFiles.txt

    Parameter 3 : 1

    OS Type : 0

    Delete File

    Parameter 1 : #AgentTemp#\files.txt

    OS Type : 0

    Delete File

    Parameter 1 : #AgentTemp#\files.count

    OS Type : 0

    ELSE





    Part 2

    Script Name: Search Unwanted Files on PC 2-2

    Script Description: Search for all. MP3, .AVI, .MPG, .MPEG, .DIVX, files on your system



    IF Check Variable

    Parameter 1 : #files#

    > :0

    THEN

    Write Script Log Entry

    Parameter 1 : There where #files# unwanted files found.

    OS Type : 0

    ELSE

    Write Script Log Entry

    Parameter 1 : No unwanted files detected.

    OS Type : 0





    Note, in the link provided there are other methods just as good, or better depending on the user....

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty
  • Well, I tried it on the computer that should have this file, and I can't make it work. I think I have screwed it up somehow. Can you look at it and tell me where I went wrong? I have not done scripts before and so this is all new territory for me.
    thanks for helping.


    Script Name: E-recording Part 1
    Script Description: Search for Erecording files

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : AgentTemp
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Search for unwanted files started.
    OS Type : 0
    Execute Shell Command
    Parameter 1 : for .cahche in (C D E) do if exist .cache:* for %b in (tyler_empire_document_documentcode.cache) do dir %a:\*.%b /s /a /b>>>>"#AgentTemp#"\files.txt
    Parameter 2 : 1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : type #AgentTemp#\files.txt|find /c ":" >>"#AgentTemp#"\files.count
    Parameter 2 : 1
    OS Type : 0
    Get Variable
    Parameter 1 : 1
    Parameter 2 : #AgentTemp#\files.count
    Parameter 3 : files
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Number of unwanted files found: #files#
    OS Type : 0
    Execute Script
    Parameter 1 : Search Unwanted Files on PC 2-2 (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 :
    Parameter 3 : 0
    OS Type : 0
    Get File
    Parameter 1 : #AgentTemp#\files.txt
    Parameter 2 : FileSearch\UnwantedFiles.txt
    Parameter 3 : 1
    OS Type : 0
    Delete File
    Parameter 1 : #AgentTemp#\files.txt
    OS Type : 0
    Delete File
    Parameter 1 : #AgentTemp#\files.count
    OS Type : 0
    ELSE

    and then to the other script
    Script Name: Search Unwanted Files on PC 2-2
    Script Description: Search for all. MP3, .AVI, .MPG, .MPEG, .DIVX, files on your system

    IF Check Variable
    Parameter 1 : #files#
    > :0
    THEN
    Write Script Log Entry
    Parameter 1 : There where #files# unwanted files found.
    OS Type : 0
    ELSE
    Write Script Log Entry
    Parameter 1 : No unwanted files detected.
    OS Type : 0

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: gunco5
  • It seems that you've botched step 2, lol but no worries I did it too... and no worries I just realized that my instructions weren't very clear...


    Script Name: Search Unwanted Files on PC 1-2
    Script Description: Search for all . MP3, .AVI, .MPG, .MPEG, .DIVX, files on your system

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : AgentTemp
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Search for unwanted files started.
    OS Type : 0
    Execute Shell Command
    Parameter 1 : for %a in (C D E) do if exist %a:* for %b in (cache) do dir %a:\*.%b /s /a /b>>>>"#AgentTemp#"\files.txt
    Parameter 2 : 1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : type #AgentTemp#\files.txt|find /c ":" >>"#AgentTemp#"\files.count
    Parameter 2 : 1
    OS Type : 0
    Get Variable
    Parameter 1 : 1
    Parameter 2 : #AgentTemp#\files.count
    Parameter 3 : files
    OS Type : 0
    Write Script Log Entry
    Parameter 1 : Number of unwanted files found: #files#
    OS Type : 0
    Execute Script
    Parameter 1 : Search Unwanted Files on PC 2-2 (NOTE: Script reference is NOT imported. Correct manually in script editor.
    Parameter 2 :
    Parameter 3 : 0
    OS Type : 0
    Get File
    Parameter 1 : #AgentTemp#\files.txt
    Parameter 2 : FileSearch\UnwantedFiles.txt
    Parameter 3 : 1
    OS Type : 0
    Delete File
    Parameter 1 : #AgentTemp#\files.txt
    OS Type : 0
    Delete File
    Parameter 1 : #AgentTemp#\files.count
    OS Type : 0
    ELSE


    Note: all this does is looks at the files in C: D: and E: and parces the file extentions... In step 2 all you need to do is edit what is in the parens () to what ever file exention you are looking for.

    I've updated it to look for .cache files I'm not sure what kind of results you'll turn out. Good luck.

    PS. user the code tags it makes reading the scripts easier!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty
  • Thanks! I will try this in the morning! I appreciate your help!

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