Agent Procedures are the Swiss Army Knife of Kaseya VSA and are crucial for doing more with less. Utilizing procedures within your environment can help reduce 2-hour tasks to 2 minutes, saving valuable time for your team! Before we get started, here is Kaseya’s official reference document.
Naming Procedures
The first thing step to creating a new procedure is giving it a name. Your team having its own naming convention, whether basic or advanced, is crucial for current and new members to understand what a procedure does simply by name and allows for easier searching based on keywords.
Some examples include:
- Install – ApplicationName
- Remove – ApplicationName
- Wifi Profile – ClientName
- VPN Connection – ClientName
- Add Printer – PrinterName – ClientName
Procedure Templates
Creating procedure templates can be extremely useful by allowing team members an easy way to create a procedure based on a tried and tested procedure template. Templates can be as simple or as advanced as your expertise allows. If the procedure works, that’s all that matters. Procedures can always be modified as your skills and needs increase, just make sure you have comments to help your team members more easily understand the steps you have added. Comments can be created by starting a line off with “//” followed by an explanation of the next line or lines.

To get you started, here are a few templates for your use or just as reference. Procedure Templates
Managed Variables
When creating procedures, think BIG! If you have a solution to install that has client specific tokens, instead of having the mindset “I need a procedure for each Organization”, think “How can I utilize a single procedure for all clients?” In the same way templates can be utilized to simplify procedure creation, Managed Variables can be used to assign specific data directly to Organizations and Machine Groups and allow you to pull that data in by calling it from a procedure using the “getVariable” Parameter, assigning “Constant Value” and calling a Managed Variable by typing “<” and selecting the variable needed. You can then pass that data into the installation arguments.

How to create variables
How to call variables in procedures
Managed Variables in Managed Files
If you have software that cannot pass variables through command line arguments and requires its own installation package, you can still use a single procedure by using Managed Variables to call the location of the media from Managed Files. This solution uses Database Views to call the “groupName’ of the machine the command is executed against. The groupName is displayed as the “ReverseGroupID” which can be easily found on the Manage Agents function under the Agents module.
This solution requires you to create a folder matching the “ReverseGroupID” and placing the installer into that folder. You then call the media by using “writeFile” statement being the location, and the name of the variable. While this is not an optimal solution, it will prevent you from having multiple policies and procedures to upkeep for a single installer.


Auditing and Custom Fields
Procedures can be used to pull and store information in Custom Fields that would not be otherwise gathered by Kaseya Audits. If you can get the data to write to shell, you can write that data to a Custom Field. To do this, you need to ensure that “Return Results” is set to true and then call that data using “#global:psresult#”. You can write the data to the machine’s procedure log using the “writeProcedureLogEntry” statement or to a Custom Field by use the “updateSystemInfo” statement. This is very useful when auditing software, but not at all limited to it. Let’s look at a procedure that checks if LastPass is installed.
- PowerShell is determining if the application exists and is returning results because the TRUE option is set.
- checkVar reads the output of the above PS command from the “global:psresults” and determines if a word is present
- Based on that, the procedure uses “updateSystemInfo” to write a specific phrase to the “cPVAL LastPass Status” Custom Field

ProVal YouTube videos on Agent Procedures
Lastly! We have several videos covering the topic of Agent Procedures on our YouTube that I know you will find useful. I’ve included links here.
- Creating Agent Procedures
- Agent Procedures getVariable Types
- Agent Procedure – Managed File Variable
- Comments and Basic Logic Checks
- Using SharedFiles in a Procedure
- Testing Agent Procedures
- Managed Variables
- VSA Basics – Custom Fields
For more information or tips and tricks on Kaseya VSA please reach out to us!