Kaseya Community

Enabling 'Disabled' Remote Control ....for K2 !

  • Hi Guys, As I recently migrated to K2, I quickly realised that many of my old scripts needed 'tweaking' due to a change in Kaseya Architecture (for the better mind you). With regards to remote control, Kaseya got a bit tricky with the new version. The registry value that determines if a user has disabled remote control on their agent, is only present when they have it in disabled mode. So instead of simply toggling a registry value between 0 and 1, they actually delete the entire value. I can only guess that this was done to so as to deter the creation of scripts like this ;-) Now as each K2 installation is unique, you will have to modify the following scipts so that they will work with your agents. Substitue your compay's unique agent string for the XXXXXXX in the code below.

      <?xml version="1.0" encoding="utf-8" ?> 
    - <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="Enable - Remote Control" treePres="3">
    - <Body description="This script will enable the remote control on a machine where is has been disabled. It does this by copying a batch file to the more computer that will stop the KaseyaAgent service, change the appropriate registry value to enable remote control, then start the KaseyaAgent service. Written by Joshua Niland, joshua.niland@xcentral.com.au">
    - <If description="">
    - <Condition name="CheckRegistryValue">
      <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Kaseya\Agent\XXXXXXX\EnableRemoteControl" /> 
      <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" /> 
      <Parameter xsi:type="StringParameter" name="Value" value="" /> 
      </Condition>
    - <Then>
    - <Statement description="" name="WriteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl32.cmd" /> 
      <Parameter xsi:type="StringParameter" name="ManagedFile" value="VSASharedFiles\EnableRemoteControl32.cmd" /> 
      </Statement>
    - <Statement description="" name="ExecuteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl32.cmd" /> 
      <Parameter xsi:type="StringParameter" name="Arguments" value="" /> 
      <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" /> 
      <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="False" /> 
      </Statement>
      </Then>
      </If>
    - <If description="">
    - <Condition name="CheckRegistryValue64">
      <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Kaseya\Agent\XXXXXXX\EnableRemoteControl" /> 
      <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" /> 
      <Parameter xsi:type="StringParameter" name="Value" value="" /> 
      </Condition>
    - <Then>
    - <Statement description="" name="WriteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl64.cmd" /> 
      <Parameter xsi:type="StringParameter" name="ManagedFile" value="VSASharedFiles\EnableRemoteControl64.cmd" /> 
      </Statement>
    - <Statement description="" name="ExecuteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl64.cmd" /> 
      <Parameter xsi:type="StringParameter" name="Arguments" value="" /> 
      <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" /> 
      <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="False" /> 
      </Statement>
      </Then>
      </If>
      </Body>
      </Procedure>
      </ScriptExport>
    
    Here is the batchfile for 32bit systems.
    net stop "Kaseya Agent"
    reg delete HKLM\SOFTWARE\Kaseya\Agent\XXXXXXX /v EnableRemoteControl /f
    net start "Kaseya Agent"
    
    Here is the batchfile for 64bit systems.
    net stop "Kaseya Agent"
    reg delete HKLM\SOFTWARE\Wow6432Node\Kaseya\Agent\XXXXXXX /v EnableRemoteControl /f
    net start "Kaseya Agent"
    
    Enjoy ...and use wisely!

    Legacy Forum Name: Enabling 'Disabled' Remote Control ....for K2 !,
    Legacy Posted By Username: XeviouS



    [edited by: Brendan Cosgrove at 5:30 PM (GMT -8) on 12-17-2010] .
  • XeviouS
    Hi Guys, As I recently migrated to K2, I quickly realised that many of my old scripts needed 'tweaking' due to a change in Kaseya Architecture (for the better mind you). With regards to remote control, Kaseya got a bit tricky with the new version. The registry value that determines if a user has disabled remote control on their agent, is only present when they have it in disabled mode. So instead of simply toggling a registry value between 0 and 1, they actually delete the entire value. I can only guess that this was done to so as to deter the creation of scripts like this ;-) Now as each K2 installation is unique, you will have to modify the following scipts so that they will work with your agents. Substitue your compay's unique agent string for the XXXXXXX in the code below.
      <?xml version="1.0" encoding="utf-8" ?> 
    - <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="Enable - Remote Control" treePres="3">
    - <Body description="This script will enable the remote control on a machine where is has been disabled. It does this by copying a batch file to the more computer that will stop the KaseyaAgent service, change the appropriate registry value to enable remote control, then start the KaseyaAgent service. Written by Joshua Niland, joshua.niland@xcentral.com.au">
    - <If description="">
    - <Condition name="CheckRegistryValue">
      <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Kaseya\Agent\XXXXXXX\EnableRemoteControl" /> 
      <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" /> 
      <Parameter xsi:type="StringParameter" name="Value" value="" /> 
      </Condition>
    - <Then>
    - <Statement description="" name="WriteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl32.cmd" /> 
      <Parameter xsi:type="StringParameter" name="ManagedFile" value="VSASharedFiles\EnableRemoteControl32.cmd" /> 
      </Statement>
    - <Statement description="" name="ExecuteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl32.cmd" /> 
      <Parameter xsi:type="StringParameter" name="Arguments" value="" /> 
      <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" /> 
      <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="False" /> 
      </Statement>
      </Then>
      </If>
    - <If description="">
    - <Condition name="CheckRegistryValue64">
      <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Kaseya\Agent\XXXXXXX\EnableRemoteControl" /> 
      <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" /> 
      <Parameter xsi:type="StringParameter" name="Value" value="" /> 
      </Condition>
    - <Then>
    - <Statement description="" name="WriteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl64.cmd" /> 
      <Parameter xsi:type="StringParameter" name="ManagedFile" value="VSASharedFiles\EnableRemoteControl64.cmd" /> 
      </Statement>
    - <Statement description="" name="ExecuteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl64.cmd" /> 
      <Parameter xsi:type="StringParameter" name="Arguments" value="" /> 
      <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" /> 
      <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="False" /> 
      </Statement>
      </Then>
      </If>
      </Body>
      </Procedure>
      </ScriptExport>
    
    Here is the batchfile for 32bit systems.
    net stop "Kaseya Agent"
    reg delete HKLM\SOFTWARE\Kaseya\Agent\XXXXXXX /v EnableRemoteControl /f
    net start "Kaseya Agent"
    
    Here is the batchfile for 64bit systems.
    net stop "Kaseya Agent"
    reg delete HKLM\SOFTWARE\Wow6432Node\Kaseya\Agent\XXXXXXX /v EnableRemoteControl /f
    net start "Kaseya Agent"
    
    Enjoy ...and use wisely!

    Nice... Are you just copying out of IE/ And can you fix my right shift key Sad

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



    [edited by: Brendan Cosgrove at 5:30 PM (GMT -8) on 12-17-2010] .
  • XeviouS
    Hi Guys, As I recently migrated to K2, I quickly realised that many of my old scripts needed 'tweaking' due to a change in Kaseya Architecture (for the better mind you). With regards to remote control, Kaseya got a bit tricky with the new version. The registry value that determines if a user has disabled remote control on their agent, is only present when they have it in disabled mode. So instead of simply toggling a registry value between 0 and 1, they actually delete the entire value. I can only guess that this was done to so as to deter the creation of scripts like this ;-) Now as each K2 installation is unique, you will have to modify the following scipts so that they will work with your agents. Substitue your compay's unique agent string for the XXXXXXX in the code below.
      <?xml version="1.0" encoding="utf-8" ?> 
    - <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="Enable - Remote Control" treePres="3">
    - <Body description="This script will enable the remote control on a machine where is has been disabled. It does this by copying a batch file to the more computer that will stop the KaseyaAgent service, change the appropriate registry value to enable remote control, then start the KaseyaAgent service. Written by Joshua Niland, joshua.niland@xcentral.com.au">
    - <If description="">
    - <Condition name="CheckRegistryValue">
      <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Kaseya\Agent\XXXXXXX\EnableRemoteControl" /> 
      <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" /> 
      <Parameter xsi:type="StringParameter" name="Value" value="" /> 
      </Condition>
    - <Then>
    - <Statement description="" name="WriteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl32.cmd" /> 
      <Parameter xsi:type="StringParameter" name="ManagedFile" value="VSASharedFiles\EnableRemoteControl32.cmd" /> 
      </Statement>
    - <Statement description="" name="ExecuteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl32.cmd" /> 
      <Parameter xsi:type="StringParameter" name="Arguments" value="" /> 
      <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" /> 
      <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="False" /> 
      </Statement>
      </Then>
      </If>
    - <If description="">
    - <Condition name="CheckRegistryValue64">
      <Parameter xsi:type="StringParameter" name="RegistryPath" value="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Kaseya\Agent\XXXXXXX\EnableRemoteControl" /> 
      <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" /> 
      <Parameter xsi:type="StringParameter" name="Value" value="" /> 
      </Condition>
    - <Then>
    - <Statement description="" name="WriteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl64.cmd" /> 
      <Parameter xsi:type="StringParameter" name="ManagedFile" value="VSASharedFiles\EnableRemoteControl64.cmd" /> 
      </Statement>
    - <Statement description="" name="ExecuteFile" continueOnFail="false">
      <Parameter xsi:type="StringParameter" name="Path" value="%TEMP%\EnableRemoteControl64.cmd" /> 
      <Parameter xsi:type="StringParameter" name="Arguments" value="" /> 
      <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="System" /> 
      <Parameter xsi:type="BooleanParameter" name="WaitComplete" value="False" /> 
      </Statement>
      </Then>
      </If>
      </Body>
      </Procedure>
      </ScriptExport>
    
    Here is the batchfile for 32bit systems.
    net stop "Kaseya Agent"
    reg delete HKLM\SOFTWARE\Kaseya\Agent\XXXXXXX /v EnableRemoteControl /f
    net start "Kaseya Agent"
    
    Here is the batchfile for 64bit systems.
    net stop "Kaseya Agent"
    reg delete HKLM\SOFTWARE\Wow6432Node\Kaseya\Agent\XXXXXXX /v EnableRemoteControl /f
    net start "Kaseya Agent"
    
    Enjoy ...and use wisely!

    Smile Very good and best used in very controlled and limited circumstances in order to keep the clients happy. You may wish to change "It does this by copying a batch file to the more computer" to "It does this by copying a batch file to the remote computer" though. Wink

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



    [edited by: Brendan Cosgrove at 5:31 PM (GMT -8) on 12-17-2010] .
  • What do I do if it's a MAC OS?  We have a new MAC out there, and for some reason we cannot connect to it .. it's not underlined in blue like the others, but live connect says it's online but user disabled RC.   I can't figure out what to do to get into this machine.   Also, the icon on the left doesnt look like the others, it's a small AC Plug looking thing instead of the usual blue or yellow icon with white profile / face that we usually see - can anyone help?

  • I'm almost positive this no longer functions as Kaseya appends a string of numbers on the end of the registry key now.

  • A batch file with this works:

    reg query HKLM\Software\Wow6432node\kaseya\agent | find "agent\" > "%temp%\agent.txt"

    net stop "Kaseya Agent"

    for /f "delims=" %%a in (%temp%\agent.txt) do reg delete %%a /v EnableRemoteControl /f

    net start "Kaseya Agent"

    del "%temp%\agent.txt"

  • That's the 64-bit version. For 32bit change the first line to:

    reg query HKLM\Software\kaseya\agent | find "agent\" > "%temp%\agent.txt"

  • Thank you sir!

  • I hope they added this in 6.3 in the remote control page. Why have the disable RC feature built-in and accessible through the Kaseya Agent Menu if we have to use a community script to reverse it?   blah

  • The remote control page I believe is identical, but I think on 6.2 there was the option on the menu to uncheck the Disable Remote control menu option so the users don't see it isn't there?

  • The Disable Remote Control you're talking about is on the Agent Menu option under the Agent tab.

  • Ok, I'm sorry for chiming in again, but I could really use a little assistance for a 6.3 version of this.  Just hoping Ghettomaster, or someone else on here, could help me with a 6.3 version of this script, as they are no longer laid out the same way.

    I thank anyone who can help, in advance.

  • I haven't spent a lot of time with 6.3 myself yet sorry Eric.

  • Don't think you can enable RC in 6.3 like you could in earlier versions.

  • Procedure Enable Remote Control.xml

    @Eric - the attached procedure works with 6.3

    It's pretty much the same as the one at the top of this that I've customised a little.