Kaseya Community

Preventing KAV to remind End Users that the license is soon to expire

  • Hello...

    Just wondering if there is a way to prevent KAV (1.4) / Kaspersky AV 6 popping up the following to the end user ?

    It is even more annoying because:

    • it makes the client pointing it out to us (although I already knew about it, but it's not really helping make us look good)
    • all my endpoints are set to "Auto Extend" ...

    I'd have thought that is the endpoint is set to "Auto Extend", the Kaseya would automatically deploy an Extended license.key file, which in turn should prevent Kaspersky AV to remind the end user.

    Any idea will be appreciated.

    Francis Germain

  • I found this little nugget and plan on testing on our endpoints.  community.kaseya.com/.../84390.aspx

    May want to check it out as well.

  • Thanks for the hint.

    But the KAV password is hard coded in the procedure... I guess it's easy enough to change it...

    The thing is, in my ongoing research for perfection, I was trying to find a way to read the password from the KSUBSCRIBER database into a variable.

     

    Unfortunately, Kaseya does not allow Get Variable (constant Value) to receive the result of a SQL command:

    Parameter 1: 2
    Parameter 2: +++SQLCMD:select UninstallPassword from kav.KasperskyFeature where agentguid = +++GETVARGUID:
    Parameter 3: UninstPwd
    Continue On Fail: False
    OS Type: 0 (All Windows operating systems)

     

    You cannot directly type it in the editor ( it refuses to save)

    You cannot even trick the system by importing the procedure from a XML file (it tells you the syntax is reserved for system scripts)

    I guess I could try by setting a Script ID below 999, bu I don't want to go that far.

    Maybe I'll ask as a feature request the ability to type SQL query, the condition being it has to be a simple SELECT statement (i.e. no UPDATE, DELETE, TRUNCATE, DROP, etc...)

     

    Anyway, I found a better way to do it...

    Based on the principle that Kaseya already does the job for you (when you click on the Update function in KAV) I went in the database and found the system procedure doing the job: "KAV: Update License File" script ID 343. Below is the content of the procedure.

    KAV: Update License File (Script ID: 343)
    if True THEN Get Variable     
                   Parameter 1: 10
                   Parameter 2: null
                   Parameter 3: agentTempDir
                   Continue On Fail: False
                   OS Type: 0 (All Windows operating systems)
            THEN Write File     
                   Parameter 1: #agentTempDir#\KAV\kav_command_addkey.lua
                   Parameter 2: vsahiddenfiles\kav\scripts\kav_command_addkey.lua
                   Parameter 3: null
                   Continue On Fail: False
                   OS Type: 0 (All Windows operating systems)
            THEN Write File     
                   Parameter 1: #agentTempDir#\KAV\update.key
                   Parameter 2: vsahiddenfiles\kav\Update.key
                   Parameter 3: null
                   Continue On Fail: False
                   OS Type: 0 (All Windows operating systems)
            THEN Run DLL Command     
                   Parameter 1: KaLua.dll
                   Parameter 2: -componentId KAV -runLuaScript "#agentTempDir#\KAV\kav_command_addkey.lua"
                   Parameter 3: 0
                   Continue On Fail: False
                   OS Type: 0 (All Windows operating systems)

     

    So I prepared my procedure in the Kaseya Editor...

    Then I exported it (and deleted from the Kaseya UI, that's to facilitate later import),

    Then I modified the exported XML file to add a call to this script 343

    <?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="Refresh KAV Key" treePres="3" id="1117092692" folderId="860904637752521" treeFullPath="0Live.Automatic Remediation.KAV">
        <Body description="">
          <Statement name="GetVariable" continueOnFail="false">
            <Parameter xsi:type="EnumParameter" name="VariableType" value="AgentTempDirectory" />
            <Parameter xsi:type="StringParameter" name="SourceContent" value="" />
            <Parameter xsi:type="StringParameter" name="VariableName" value="AgentTemp" />
          </Statement>
          <If description="">
            <Condition name="TestFile">
              <Parameter xsi:type="StringParameter" name="Path" value="#AgentTemp#\kav\kav_command_installkaspersky.lua" />
              <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />
              <Parameter xsi:type="StringParameter" name="Value" value="" />
            </Condition>
            <Then>
              <Statement description="Exec Proc: KAV: Update License File / immediate" name="ExecuteScript" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="ScriptID" value="343" />
                <Parameter xsi:type="StringParameter" name="ScriptName" value="KAV: Update License File" />
                <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
              </Statement>
              <Statement name="PauseScript" continueOnFail="false">
                <Parameter xsi:type="IntegerParameter" name="Seconds" value="1" />
              </Statement>
              <Statement name="WriteScriptLogEntry" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Comment" value="Refresh KAV Key: License Key File Updated." />
              </Statement>
            </Then>
            <Else>
              <Statement name="WriteScriptLogEntry" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Comment" value="Refresh KAV Key: KAV is not installed." />
              </Statement>
            </Else>
          </If>
        </Body>
      </Procedure>
    </ScriptExport>

     

    And Finally, I reimported the procedure from the XML file.

     

    And voila... when I run the procedure on my laptop, the update.key file get copied under the #AgentTemp#\kav folder and I assume the DLL is run to import it in Kaspersky AV.

    11:21:25 am 30-Apr-13 Refresh KAV Key FrancisG
    Script Summary: Success THEN
    11:21:25 am 30-Apr-13 Refresh KAV Key-0001 FrancisG
    Script Summary: Success THEN
    11:21:25 am 30-Apr-13 Refresh KAV Key-0001 FrancisG
    Refresh KAV Key: License Key File Updated.
    11:21:24 am 30-Apr-13 KAV: Update License File FrancisG
    Script Summary: Success THEN
    11:21:22 am 30-Apr-13 Run Now - Refresh KAV Key FrancisG

     

    Cheers

    Francis Germain

     

  • Hi,

    We are also experiencing that some users gets this popup aswell even when autoextend is already set.

    Does the script sqwidd linked to fix this? (have not tested it out yet)

    Is there a permanent solution or do you runt this script when "it happens" ? No way to prevent it from occuring in the first place?

  • The script Squidd linked is simple and effective... but I see 2 flaws:

    - path to avp.com is hard-coded (and I'm guessing this path will change with time)

    - Kaspersky AV password is hard-coded (and I just don't like that)

    It's easy enough to change both of them in the script... or better yet:

    - get Kaseya to find the path to avp.com

    - prompt for a password at the execution.

    But I was looking for a script that can be used on every machine regardless of these 2 variables... hence the one I put above.

    Cheers

    Francis

  • I talked to one of the KAV engineers in Vegas and he said they were going to be changing the license subscriptions to two months at a time instead of only one month to see if that helps with machines that are offline for long periods of time. I don't think that is really the fix but think their thought process is that it will eliminate some of the tickets they receive.

  • Discovered recently an new function in the KAV module: there is a new button under the "Licencing" dropdown:

    This is calling the system script # 979: "KAV: Fix License File"

    So I changed my procedure (see above) as follows:

    <?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="Refresh KAV Key" treePres="3" id="1117092692" folderId="860904637752521" treeFullPath="0Live.Automatic Remediation.KAV">
        <Body description="">
          <Statement name="GetVariable" continueOnFail="false">
            <Parameter xsi:type="EnumParameter" name="VariableType" value="AgentTempDirectory" />
            <Parameter xsi:type="StringParameter" name="SourceContent" value="" />
            <Parameter xsi:type="StringParameter" name="VariableName" value="AgentTemp" />
          </Statement>
          <If description="">
            <Condition name="TestFile">
              <Parameter xsi:type="StringParameter" name="Path" value="#AgentTemp#\kav\kav_command_installkaspersky.lua" />
              <Parameter xsi:type="EnumParameter" name="Condition" value="Exists" />
              <Parameter xsi:type="StringParameter" name="Value" value="" />
            </Condition>
            <Then>
              <Statement description="Exec Proc: KAV: Update License File / immediate" name="ExecuteScript" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="ScriptID" value="979" />
                <Parameter xsi:type="StringParameter" name="ScriptName" value="KAV: Fix License File" />
                <Parameter xsi:type="StringParameter" name="TimeDelay" value="" />
                <Parameter xsi:type="EnumParameter" name="TimeUnit" value="Immediate" />
              </Statement>
              <Statement name="PauseScript" continueOnFail="false">
                <Parameter xsi:type="IntegerParameter" name="Seconds" value="1" />
              </Statement>
              <Statement name="WriteScriptLogEntry" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Comment" value="Refresh KAV Key: License Key File Updated." />
              </Statement>
            </Then>
            <Else>
              <Statement name="WriteScriptLogEntry" continueOnFail="false">
                <Parameter xsi:type="StringParameter" name="Comment" value="Refresh KAV Key: KAV is not installed." />
              </Statement>
            </Else>
          </If>
        </Body>
      </Procedure>
    </ScriptExport>

  • I understand this is fixable, however with upwards of 4000 endpoints it is pretty embarassing for us to have a client call in and say "Why am I receiving this error AGAIN?"

    This should not be popping up on our clients' ends. It should be popping up on OUR(their MSP)'s end.

  • I have been waiting 9 days for my Licensing issue to be resolved. My ticket has been just tickled by support but no resolution. I can't continue to have end points not get updated when we have valid licenses. My ticket number is 176789. Can someone please tell me when a real person will fix this?

  • Isn't that what the "Fix Kasperksy License" button is for?

  • Yes, but it does not work or stopped working...

  • Have you manually tried the procedure referenced above or the info in this thread > community.kaseya.com/.../18412.aspx ?

  • Hi...


    Just got a reply of Kaseya Support about this one.

    They apparently fixed the "Fix Kaspersky License" button... see below.

    Kaseya Support Ticket Update

    Ticket CS173688: “Kaseya 6.3.0.0, Level 8394 - KAV 1.4.0.0, Level 1508 - Pop up reminder for Licence about to expire

    Update

    Francis,

    I was told by the KAV dev team that the 'Fix  License' button is broke.  I tried to Live connect to your Kserver to do the workaround fix but I could not Live Connect from my location (west coast of US).

    Here are the steps I need you to run:

    To apply this KAV License fix:

    1. Go to your Kaseya Server>Services
    - Shutdown KAV service
    - or open cmd and run ' net stop Kaseya Antivirus'

    2. Go to folder \Kaseya\mvcControllers\KAV\Service. Rename all below files to *.old. ie. rename Kaseya.KAV.Core.dll to Kaseya.KAV.Core.dll.OLD.

    Kaseya.KAV.Core.dll
    Kaseya.KAV.Core.pdb
    Kaseya.KAV.Model.dll
    Kaseya.KAV.Model.pdb
    Kaseya.KAV.Service.exe
    Kaseya.KAV.Service.pdb

    3. Copy the below 6 new files to \Kaseya\mvcControllers\KAV\Services

    KAV 1.4 fix kaspersky license script fix.zip

    4. Go to \kaseya\mvcControllers\KAV\Web\bin\
    Rename all below files to *.old. ie. rename Kaseya.KAV.Core.dll to Kaseya.KAV.Core.dll.OLD.
    Kaseya.KAV.Core.dll,
    Kaseya.KAV.Core.pdb,
    Kaseya.KAV.Model.dll,
    Kaseya.KAV.Model.pdb,
    Kaseya.KAV.Service.pdb

    *** DO NOT add the Kaseya.KAV.Service.exe to this foolder

    Copy the new Core and Model dlls and their pdb to the \kaseya\mvcControllers\KAV\Web\bin\ folder


    5. Restart the KAV service
        net start "Kaseya Antivirus" on cmd line or restart on Services

    Let me know when the above fix has been put into place

    Sincerely,

    Ernie

    Kaseya Support

    Regards

    Francis

  • Kaseya Support,

    Will this fix be rolled into hotfixes automatically for the rest of us?

  • Got new fix on Friday but now have a new problem. While the workstations are actually now licensed and up to date, the workstations in the panel under status are still showing a red circle with an exclamation claiming the "machine configuration is out of compliance with the profile."

    I have rebooted the workstations, hit the Get Status button under Protection, but to no avail. Its like one item gets fixed and more items break...