Kaseya Community

Script Database Access and Custom Field creation

  • I'm moving over to Kaseya from Labtech and would like to know the scripting power of Kaseya. 

    1) Does Kaseya allow us to check it's database for particular fields for clients, locations, machines that the script is running on and use those fields in the script to check if/else statements againist?

    2) Can we create a custom field for a client or computer which then we can manipulate with a script when run on a machine?

    I appreciate all your input.

    -Eugene

  • Answer to #1 is "it depends".  It depends on what data you are trying to get to and what you want to manipulate. Machine data is available using the GetVariable function (I believe that's correct, it's been a while since I've written procedures), while for security reasons there are certain database tables/fields you don't have direct access to through procedures (though you can have a list of pre-built SQL statements in an external file and call them through a procedure).

    #2 - Yes

    - Max

  • Thanks for you answers Max.

    1) So can I do a search on the DB and run a script on all machines with particular hardware or software? Is there a document on how to do this?

    2) Also any documentation on this?

    Thanks,

    Eugene

  • Start with the "Using Variables" section in the help file - help.kaseya.com/.../index.asp

    This is the specific variable you want to use:

    Automatic SQL View Data Variables - SQL view parameters are available as automatically declared procedure variables. Automatic variables enable you to skip using the GetVariable command before making use of the variable in a step. Use the format #SqlViewName.ColumnName# in a procedure to return the value of a dbo.SqlView.Column for the agent running the agent procedure. See System > Database Views for a list of the SQL views and columns that are available.

    All the DB variables that are available are documented here:

    help.kaseya.com/.../index.asp

    Good Luck

    Max

  • Hi Alpha45 - you can find info on creating custom fields here:

    help.kaseya.com/.../index.asp

  • @Alpha45 I would be interested in your opinion on which (Kaseya or Labtech) has the better scripting functionality once you get used to scripting in Kaseya.



    typo
    [edited by: HardKnoX at 3:01 PM (GMT -7) on Aug 21, 2014]
  • Hi Alpha45

    In short "Yes" and "yes" to both questions

    You can query any SQL value from the Kaseya Database and use in Scripts both in Agent procedures and Service Desk procedures

    And the Script editor has a step that allows to you update custom fields with any values you like.

    The only challenge is in knowing where to find the data i.e. in what table or view .. but there is a wealth of knowledge here so just ask a way .. or email me directly on my address below

    Always happy to help out