VSA Managed Variables offer an excellent way to provide customer and machine-group specific values for use in Agent Procedures. We have more than 20 unique Managed Variables defined to help configure application licenses, define local account credentials, and control how applications are deployed and used. It suffers, however, from one very debilitating bug. If the variable is not defined for all customers and machine groups, it can cause the procedure to fail when the variable is not defined. There is no way to test the variable to determine if it is defined or not, and the simple act of referencing the undefined variable will terminate the procedure, even if "Continue on Fail" is selected.
MSP Builder has developed a work-around for this using a SQL Query. The query is invoked with two user arguments - the name of the Managed Variable and a Default Value. The query looks up the Managed Variable based on the agent's machine.group value. If the value is defined, it is returned, otherwise the default value is returned instead. This allows you to perform tasks using Managed Variables with greater flexibility - either use a custom or default value, or perform a task only when a custom value is defined. We use this to create a customer-specific local account, only for customers that request this.
You can download the XML file that defines the SQL Query. The Zip file contains the XML file and a readme that illustrates how to use this in a procedure, and describes the installation steps. For SaaS customers, you will need to create a request to have this query installed into your instance. Do not change the XML filename or contents to insure that your request is not delayed. Kaseya will need to review the procedure and approve it before installation for SaaS customers.
See "Managed Vars - Take 2" for a method that works on SAAS or On-Prem without any SQL code!