Google chrome logo

Set Google Chrome as Default Browser

Change default browser to Chrome

Description

This agent procedure will set the default browser to Google Chrome for the current logged in user.
It will not affect any other user but the one that is considered "Current Logged In User" in the VSA. The changes take effect immediately, a reboot is not required, but the user then still has access to change the default browser manually.

Google Chrome needs to be installed on the endpoint prior to scheduling the Agent Procedure.

This is for Windows endpoints only.

Developer
  • Name: Douglas Sanchez
  • Company: Kaseya
  • Website: http://www.kaseya.com
  • Contact Developer
  • Summary
  • Set Google Chrome as Default Browser
  • 278 Downloads
  • Released on December 14th, 2017
  • Discussion
    Gravatar for Paul F
    Paul F 7 months ago

    Any update on this so it works on windows 10?

    Gravatar for tarik
    tarik 7 months ago

    This works on Windows 10. Already deployed it on a scale of 200 users.

    Gravatar for Nattavut Sankaow
    Nattavut Sankaow 7 months ago

    How do you have to do it? I Would like to try it. There are 150 users.

    Gravatar for Paul F
    Paul F 7 months ago

    I exported the xml sent this script over and it does not set...

    Machine I am testing on: Windows 10 64bt Professional ver. 1909.

    Any input would really help me out.  Thanks so much.

    Gravatar for debz
    debz 7 months ago

    @Paul F yes, I tried this also. I even tried downloading first the .exe file then upload in kaseya server it but it did not work. 

    @tarik may we know how you did it? Are there any changes that needs to be done on the script? :)

    Gravatar for debz
    debz 7 months ago

    @Paul F yes, I tried this also. I even tried downloading first the .exe file then upload in kaseya server it but it did not work. 

    @tarik may we know how you did it? Are there any changes that needs to be done on the script? :)

    Gravatar for tarik
    tarik 7 months ago

    This is how my xml looks like for my procedure:


    <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">

    <Procedure name="Chrome Default Browser" treePres="3" id="1054768271" folderId="414855615661878" treeFullPath="@Team1.Versa Welzijn">

    <Body description="">

    <If description="">

    <Condition name="CheckRegistryValue">

    <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin"/>

    <Parameter xsi:type="EnumParameter" name="Condition" value="Exists"/>

    <Parameter xsi:type="StringParameter" name="Value" value=""/>

    </Condition>

    <Then>

    <Statement name="GetVariable" continueOnFail="false">

    <Parameter xsi:type="EnumParameter" name="VariableType" value="RegistryValue"/>

    <Parameter xsi:type="StringParameter" name="SourceContent" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin"/>

    <Parameter xsi:type="StringParameter" name="VariableName" value="global:ConsentPrompt"/>

    </Statement>

    <If description="">

    <Condition name="CheckVariable">

    <Parameter xsi:type="StringParameter" name="VariableName" value="#global:ConsentPrompt#"/>

    <Parameter xsi:type="EnumParameter" name="Condition" value="NotEquals"/>

    <Parameter xsi:type="StringParameter" name="Value" value="0"/>

    </Condition>

    <Then>

    <Statement name="SetRegistryValue" continueOnFail="false">

    <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin"/>

    <Parameter xsi:type="StringParameter" name="Value" value="0"/>

    <Parameter xsi:type="EnumParameter" name="DataType" value="Integer"/>

    </Statement>

    </Then>

    </If>

    </Then>

    </If>

    <Statement name="WriteFile" continueOnFail="false">

    <Parameter xsi:type="StringParameter" name="Path" value="#vAgentConfiguration.agentTempDir#\SetDefaultBrowser.zip"/>

    <Parameter xsi:type="StringParameter" name="ManagedFile" value="VSASharedFiles\Google Chrome\SetDefaultBrowser.zip"/>

    <Parameter xsi:type="BooleanParameter" name="DeleteAfter" value="False"/>

    </Statement>

    <Statement name="PauseScript" continueOnFail="false">

    <Parameter xsi:type="IntegerParameter" name="Seconds" value="10"/>

    </Statement>

    <Statement name="Unzip file" continueOnFail="true">

    <Parameter xsi:type="StringParameter" name="Parameter1" value="#vAgentConfiguration.agentTempDir#\SetDefaultBrowser.zip"/>

    <Parameter xsi:type="StringParameter" name="Parameter2" value="#vAgentConfiguration.agentTempDir#"/>

    <Parameter xsi:type="StringParameter" name="Parameter3" value="True"/>

    </Statement>

    <Statement name="ExecuteShellCommand" continueOnFail="true">

    <Parameter xsi:type="StringParameter" name="Command" value="#vAgentConfiguration.agentTempDir#\SetDefaultBrowser\SetDefaultBrowser.exe HKLM "Google Chrome" delay=2000"/>

    <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User"/>

    <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False"/>

    </Statement>

    <Statement name="PauseScript" continueOnFail="false">

    <Parameter xsi:type="IntegerParameter" name="Seconds" value="30"/>

    </Statement>

    <Statement name="Delete Directory" continueOnFail="false">

    <Parameter xsi:type="StringParameter" name="Parameter1" value="C:\CHROME\SetDefaultBrowser"/>

    <Parameter xsi:type="StringParameter" name="Parameter2" value="true"/>

    </Statement>

    <Statement name="DeleteFile" continueOnFail="false">

    <Parameter xsi:type="StringParameter" name="Path" value="C:\CHROME\SetDefaultBrowser.zip"/>

    </Statement>

    <If description="">

    <Condition name="CheckVariable">

    <Parameter xsi:type="StringParameter" name="VariableName" value="#global:ConsentPrompt#"/>

    <Parameter xsi:type="EnumParameter" name="Condition" value="Exists"/>

    <Parameter xsi:type="StringParameter" name="Value" value=""/>

    </Condition>

    <Then>

    <If description="">

    <Condition name="CheckVariable">

    <Parameter xsi:type="StringParameter" name="VariableName" value="#global:ConsentPrompt#"/>

    <Parameter xsi:type="EnumParameter" name="Condition" value="NotEquals"/>

    <Parameter xsi:type="StringParameter" name="Value" value="0"/>

    </Condition>

    <Then>

    <Statement name="SetRegistryValue" continueOnFail="false">

    <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin"/>

    <Parameter xsi:type="StringParameter" name="Value" value="#global:ConsentPrompt#"/>

    <Parameter xsi:type="EnumParameter" name="DataType" value="Integer"/>

    </Statement>

    </Then>

    </If>

    <Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter xsi:type="StringParameter" name="Comment" value="Chrome set default"/>

    </Statement>

    </Then>

    <Else>

    <Statement name="WriteScriptLogEntry" continueOnFail="false">

    <Parameter xsi:type="StringParameter" name="Comment" value="Chrome not set default"/>

    </Statement>

    </Else>

    </If>

    </Body>

    </Procedure>

    </ScriptExport>

    Gravatar for debz
    debz 7 months ago

    Hi Tarik,

    Thanks for posting your script. Tried it but encountered some errors.

    I cannot find "PauseScript" in kaseya's list. I also tried to copy and paste your script but it says "The text you are trying to import is not a valid XML import format."

    Gravatar for debz
    debz 7 months ago

    Hi,

    I just read the information on github about this script:

    "Windows 10 version 1709 or below. Versions 1803 and higher are not supported since this app uses UI automation for a control panel applet that is now removed from Windows.

    The current windows that is installed on the pc is  V1909

    https://github.com/sampalmer/set-default-browser

    Gravatar for debz
    debz 6 months ago

    I have an update on this. It worked. Just need to download the SetDefaultBrowser.exe on https://kolbi.cz/blog/2017/11/10/setdefaultbrowser-set-the-default-browser-per-user-on-windows-10-and-server-2016-build-1607/

    On kaseya  executeshellcommand for Google Chrome and it works fine on windows 10 1909

    Gravatar for debz
    debz 6 months ago

    This is how i did it:
    1. download the SetDefaultBrowser.exe

    2. upload on kaseya server

    on kaseya script:

    1. download the SetdefaultBrowser.exe to temp file

    2. executeshellcommand ("#agentDrv#temp\SetDefaultBrowser.exe HKLM "Google Chrome"", ...)
    HKLM is needed in order for it to work on windows 10 1909. On the original code the "HKLM" was not included but on  https://kolbi.cz/ there is an info that if you run on cmd prompt to add the HKLM and it worked.

    Hope this helps