Kaseya Community

Safe mode script?

  • I was wondering if there is a script that can have the computer reboot into safe mode with networking so that we could still remote into the machine?

    Any help is appreciated.


    Legacy Forum Name: Safe mode script?,
    Legacy Posted By Username: Joshrhoden
  • I BELIEVE that some of the reboot EXE programs out there (do a Google search or similar) support rebooting into safe mode. Not sure if you can specifically choose with networking.

    But in safe mode, Kaseya isn't running (part of the PURPOSE of safe mode), so no way to remote in.


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: warever
  • safemodeboot.zip
    Reboot to Normal Mode

    Script Name: Reboot to Normal Mode
    Script Description:

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : temp
    OS Type : 0
    Write File
    Parameter 1 : #temp#SafeModeNormal.vbs
    Parameter 2 : VSASharedFiles\VB Files\SafeModeNormal.vbs
    OS Type : 0
    Execute Shell Command
    Parameter 1 : wscript "#temp#SafeModeNormal.vbs"
    Parameter 2 : 1
    OS Type : 0
    Delete File
    Parameter 1 : #temp#SafeModeNormal.vbs
    OS Type : 0
    Reboot
    OS Type : 0
    ELSE



    Reboot to Safe Mode

    Script Name: Reboot to Safe Mode
    Script Description:

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : temp
    OS Type : 0
    Get Variable
    Parameter 1 : 0
    Parameter 2 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AgentMon.Exe\Path
    Parameter 3 : installpath
    OS Type : 0
    Write File
    Parameter 1 : #temp#SafeModeBoot.vbs
    Parameter 2 : VSASharedFiles\VB Files\SafeModeBoot.vbs
    OS Type : 0
    Write File
    Parameter 1 : #temp#safemode_reboot_kausrtsk.reg
    Parameter 2 : VSASharedFiles\Reg Files\safemode_reboot_kausrtsk.reg
    OS Type : 0
    Write File
    Parameter 1 : #temp#safemode_reboot_kausrtskwin2k.reg
    Parameter 2 : VSASharedFiles\Reg Files\safemode_reboot_kausrtskwin2k.reg
    OS Type : 3
    Write File
    Parameter 1 : #temp#instsrv.exe
    Parameter 2 : VSASharedFiles\Misc Files\instsrv.exe
    OS Type : 0
    Execute Shell Command
    Parameter 1 : #temp#instsrv.exe "KaUsrTsk" #installpath#kausrtsk.exe
    Parameter 2 : 1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : regedit.exe /s "#temp#safemode_reboot_kausrtsk.reg"
    Parameter 2 : 0
    OS Type : 0
    Execute Shell Command
    Parameter 1 : regedit.exe /s "#temp#safemode_reboot_kausrtskwin2k.reg"
    Parameter 2 : 0
    OS Type : 3
    Execute Shell Command
    Parameter 1 : wscript "#temp#SafeModeBoot.vbs"
    Parameter 2 : 1
    OS Type : 0
    Delete File
    Parameter 1 : #temp#safemode_reboot_kausrtsk.reg
    OS Type : 0
    Delete File
    Parameter 1 : #temp#safemode_reboot_kausrtskwin2k.reg
    OS Type : 0
    Delete File
    Parameter 1 : #temp#SafeModeBoot.vbs
    OS Type : 0
    Reboot
    OS Type : 0
    ELSE


    I will zip the two VB scripts.


    God Bless,
    Marty


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: MissingLink
  • Hay Marty,

    This script rocks!

    Don't mean to crab but could you do us a favor (or three)?

    1) Copy the K script to a txt file and add it to the zip? This wonderful forum jumbles the script all to junk (missing characters, etc)

    2) Include the two reg files needed in the zip? safemode_reboot_kausrtsk.reg and safemode_reboot_kausrtskwin2k.reg

    3) Either include or direct us to where to find instsrv.exe

    Thanks again on your efforts on this excellent script!

    --shawn


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: Masterson
  • Files.zip
    Other than the VB files which were included earlier, this is everything you need to perform these scripts.

    God Bless,
    Marty


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: MissingLink
  • Marty, thanks a ton for taking the time :-D

    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: Masterson
  • Great work Marty! Much appreciated!


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: jamie177
  • Thank you just got on and noticed all the replies... Thanks for all of your help!!!





    - Josh


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: Joshrhoden