Kaseya Community


  • Is there a way I can declare a variable and use it any  form of procedure? like for example.. I declared a variable in service desk., can I use that in agent procudure? thanks!

  • Hi Caye,

    I guess it depends how you want to declare the variable. If you use a script to declare it I would use Custom Fields to set and retrieve the data. Otherwise the if its just a org level variable there is always the managed variables which can be used throughout Kaseya.



  • hmm. I'm not very much familiar yet in scripting using Kaseya scripting wizard. Can you explain how does the managed variables work?

    the scenario is this,

    In service desk, I have a custom field called "Username" ..what I want to do is when a requestor input a username then submit the ticket,  a procedure called "AD standard User" (that is created in the AGENT PROCEDURE) that will automatically create a domain user in Active Directory using that value of the Username field in the ticket. The command  I used is "Create Domain User (run on Domain Controller)"

    I'm thinking this would work when variables are properly declared and assigned. but im not sure how.

  • Hi Caye,

    Unfortunately neither of my methods will work for your case. I don't use service desk yet myself but I believe the custom fields for tickets in service desk are the same as the custom fields against organisations under the system tab. As far as i know there is no way of referencing these values with a normal agent procedure and you will have to do it with a service desk agent procedure as these run slightly different.

    I would guess the best way to achieve what you want would be to have a Service Desk procedure call a normal agent procedure with a global variable but i guess this leads back to your original question of if variables are passed through.

    Maybe one of the other guys can chip in here as I'm not 100% sure on this.



  • By creating your own SQL Database views you can access any of the custom fields created in either the Organization and/or custom fields created against the machines.

    This means both your Agent procedure and your Service Desk procedures can read / update etc the same fields , allowing you to effectively pass the information ( variable ) from an Agent procedure to SD and visa versa.

  • Do you usually do this, paul? Anyway, I'll definitely try what you sad. thanks!

  • Hi Paul, Iw as just wondering if Kaseya has a table in SQL for the Service Desk?

  • Yes .. there are dozens of SD tables. Open SQL Management Studio and scroll through the Ksubscribers DB until you find the Kasadmin Schema. All the SD tables should be there.

  • Be warned though .. accessing data directly from table may work now , but if Kaseya change the DB in anyway then your queries etc will stop working.

    It's safer to ask use Kaseya's published sqlviews

    So anyway ...Run this query .. and it willl list them all for you

    use ksubscribers


    where TABLE_SCHEMA = 'kasadmin'