Kaseya Community

SpyBot 1.6.2 Final Script (K2)

  • SpyBot1.6.2-Final.zip
    Hello Everyone,
    I have been on the forums a lot over the past few years with Kaseya and shared my scripts I felt took time or would be useful to others. Well today I'm back with my next round of SpyBot scripts. Attached is the Exported folder and files from the VSAShared folder (all in a ZIP, minus spybot install file) for my latest (and hopefully last) SpyBot script. This script is compatible with all versions of Windows commonly managed today (Windows XP X86, Windows XP X64, Windows Vista X86, Windows Vista X64, Windows 7 X86, and Windows 7 X64). I have done my very best to ensure the script will work for you and that everyone will be able to use it. I will note that all testing was done in Vista and Windows 7 with UAC off, this is how we run our managed networks so I had no desire to spend additional time trying to get it to work with UAC on.

    The folder contains the following scripts (10 scripts with descriptions to follow). The reason these steps were broken into sub scripts and not nested IF/Then statements is due to K2's SERIOUS issues that Kaseya refuses to resolve were nested scripts get auto rolled into sub script that cannot be edited, exported, or worked on, because of this issue K2 scripting is no better than Kaseya 2008 scripting. This was very frustrating but it was done for that reason.

    You will need to modify the email address to sent the non removable report to in step 5 as well as relink the files from your Kaseya server shared folder before running the script. Below is the path the files resided on my server.

    \\KaseyaServer\c$\Kaseya\WebPages\ManagedFiles\VSASharedFiles\Script Files\SpyBot1.6.2Final

    SpyBot install file was not included in the attachment to save 15mb of space, please download latest version and link to two install scripts.

    Not sure if K2 imported scripts hold the script linking better but if not you should be able to relink them without to much trouble.


    1. SpyBot-1.6.2-Final-Overall
    2. [INDENT]This is the main script that would be scheduled, it calls the sub scripts starting with step 1 to check for X86 or X64[/INDENT]
    3. SpyBot-Install-1.6.2-X64
    4. [INDENT]Installs SpyBot 1.6.2 if not found as currently installed by "SpyBot-Step2-X64-SDFILES" script [/INDENT]
    5. SpyBot-Install-1.6.2-X86
    6. [INDENT]Installs SpyBot 1.6.2 if not found as currently installed by "SpyBot-Step2-X86-SDFILES" script [/INDENT]
    7. SpyBot-Step1-Checkx64
    8. [INDENT]Checks if the operating system is x64 or x86, another let down that Kaseya 2 scripting did not implement[/INDENT]
    9. SpyBot-Step2-X64-SDFILES
    10. [INDENT]Checks for the existence of the "sdfiles.exe" file, this is used to check for SpyBot 1.6.2 since this file was new in 1.6.2[/INDENT]
    11. SpyBot-Step2-X86-SDFILES
    12. [INDENT]Checks for the existence of the "sdfiles.exe" file, this is used to check for SpyBot 1.6.2 since this file was new in 1.6.2[/INDENT]
    13. SpyBot-Step3-UpdateRunSpyBot-x64
    14. [INDENT]The core of the script, starts by deleting all previous log files, and configuration ini files. Then writes the versions of the configuration files from the Kaseya folder. Then executes a SpyBot update, then runs SpyBot. Once SpyBot has finished running, it executes the UploadFixFile script.[/INDENT]
    15. SpyBot-Step3-UpdateRunSpyBot-x86
    16. [INDENT]The core of the script, starts by deleting all previous log files, and configuration ini files. Then writes the versions of the configuration files from the Kaseya folder. Then executes a SpyBot update, then runs SpyBot. Once SpyBot has finished running, it executes the UploadFixFile script.[/INDENT]
    17. SpyBot-Step4-UploadFixFile
    18. [INDENT]Renamed and writes the Fix file to the agent procedure log, we use this in conjunction with a flag in our executive summary to report on number of SpyWare removed in the company[/INDENT]
    19. SpyBot-Step5-RunOnce
    20. [INDENT]Checks for the existence of the RunOnce registry key to run SpyBot on start up, if found, the key is deleted and an email is sent to our engineers to remove the infection manually.[/INDENT]


    As mentioned above, I have tested this script as best I can with time provided but please report back any issues you have. I can be reached at the contact information below as well if you have any comments or questions or bugs to report. I believe in open communication within our community and would be happy to talk.

    Thanks,
    Daryl Jennings
    (619) 298-5100 x702
    djennings@bravuranetworks.com
    Senior Technical Engineer

    Legacy Forum Name: SpyBot 1.6.2 Final Script (K2),
    Legacy Posted By Username: djennings
  • Good script. Very detailed. However, there seems to be an issue with the script when it is the first install of the machine. The scripts fail out because the txt documents dont exist.

    It is possible I have something out of order.

    What order does the "overall" need to be in. What needs to be in that to make it work like you had it working?

    Thanks!

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: chris-teamadna
  • The script will fail the first run on a PC after install, if a user is logged into the machine. This is due to the way Kaseya is programmed. Since you launch a SpyBot update by running the spybot.exe file with a /update flag, kaseya checks to see when the "spybot.exe" file ends to move onto the next script step. The problem is the first update on a PC takes a while and the spybot.exe file ends while sdupdate.exe is still running. I have not had an issue with any subsequent runs of the script though, just the first one.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: djennings
  • djennings
    The script will fail the first run on a PC after install, if a user is logged into the machine. This is due to the way Kaseya is programmed. Since you launch a SpyBot update by running the spybot.exe file with a /update flag, kaseya checks to see when the "spybot.exe" file ends to move onto the next script step. The problem is the first update on a PC takes a while and the spybot.exe file ends while sdupdate.exe is still running. I have not had an issue with any subsequent runs of the script though, just the first one.


    To avoid this you need to create multiple scripts.

    The first script initiates the Spybot update, then schedules the second script. The second script checks to see if spybot.exe is still running, and if so, reschedules itself. If it is not running, it performs whatever subsequent actions are required.

    My experience is having K2 have multiple IFs isn't actually that useful, as I tend to use this technique a lot. In fact, of the 400 or so scripts we currently have, only a handful would benefit from multiple IFs.

    Andrew

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: andrew.doull@computer-care.com.au
  • [QUOTE=andrew.doull@computer-care.com.au;58295]To avoid this you need to create multiple scripts.

    The first script initiates the Spybot update, then schedules the second script. The second script checks to see if spybot.exe is still running, and if so, reschedules itself. If it is not running, it performs whatever subsequent actions are required.

    My experience is having K2 have multiple IFs isn't actually that useful, as I tend to use this technique a lot. In fact, of the 400 or so scripts we currently have, only a handful would benefit from multiple IFs.

    Andrew[/QUOTE]

    Hello Andrew, your correct this would be a soltion (although you need to check for sdupdate.exe and not spybot.exe) but either way i have chosen not to do so as the issue is only found on the first run after a fresh install.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: djennings
  • Any clue why I can't import the xml? I get "The type 'Kaseya.Scripting.Actions.ExecuteScript' does not contain a property, field or method with the name 'ScriptID'.

    I'm sure it's no problem with your script, but 9 times out of 10 - I can't import scripts.

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