Kaseya Community

Search all machines for files

  • I need to be able to search all my managed machines for specific folders (we're looking for lost data). I had thought of doing a simple "dir/s" script that would dump results into a local log file (e.g. dir /s missingfile.dat > logfile.txt). But I'm not sure how to alert on JUST the pc's that the folder is found on (all pc's will create the logfile.txt file, even if it doesn't find the folder.

    So, anyone have a good idea on how to do a hard drive search on machines and alert on ONLY the pc's that have a positive hit? I have a feeling I'm over-thinking this...it can't be that hard Smile

    Thanks ahead of time!


    Legacy Forum Name: Search all machines for files,
    Legacy Posted By Username: jfranks@get-covered.com
  • Jf,

    Hello.I would suggest the following:

    At the end of the script you have written to create the text file containing the output from the search, use the Kaseya command EXECUTE SCRIPT and call a second script.

    At the beginning of that second script, Use the IF TestFile command, enter the name of the text file created by the first script (ie such as #vAgentConfiguration.agentTempDir#\filename.txt) and then select the CONTAINS option, and enter the test you are searching for.

    Then in the body of the script, add code for what you want to do, such as write somethign to the script log, send an email message or something.

    Hope this helps.


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: lwolf
  • Thanks Lloyd,

    Worked like a top! Even made it fun Smile

    thanks again!


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: jfranks@get-covered.com