IF-ELSE-STEP Commands

The following is a summary of standard IF-ELSE-STEP commands used in VSA agent procedures.

IF Definitions

checkVar()

Evaluates the given agent variable. See Using Variables.

else

Adds an Else branch to run steps when an If branch returns a False result.

eval()

Compares a variable with a supplied value.

getOS()

Determines if the current Windows OS is 32 or 64-bit.

getRAM()

Evaluates the total amount of memory reported by the latest audit of the agent.

getRegistryValue()

Evaluates the given registry value.

hasRegistryKey()

Tests for the existence of the given registry key.

isAppRunning()

Checks to see if a specified application is currently running on the managed machine.

isServiceRunning()

Determines if a service is running on the managed machine.

isUserActive()

Determines whether the user is either:

  • Idle or not logged on, or
  • Active

isUserLoggedin()

Tests whether a specific user, or any user, is logged in or not.

isYesFromUser()

Presents a Yes/No dialog box to the user.

testFile()

Tests for the existence of a file.

testFileInDirectoryPath()

Tests for the existence of a file in the current directory path returned by getDirectoryPathFromRegistry().

true

Always returns True, executing If branch.

STEP Definitions

alarmsSuspend()

Suppresses alarms on a machine for a specified number of minutes.

alarmsUnsuspendAll()

Stops the suppression of alarms on a machine.

captureDesktopScreenshot()

Captures a desktop screenshot of the agent machine and uploads it to the Kaseya Server.

changeDomainUserGroup()

Changes a domain user's membership in a domain user group.

changeLocalUserGroup()

Changes a local user's membership in a local user group.

closeApplication()

Closes a running application.

comment()

Adds a one-line comment to the procedure.

copyFile()

Copies a file from one directory to another.

copyFileUseCredentials()

Copies a file from one directory to another using a user credential.

createDomainUser()

Adds a new user to an Active Directory domain when run on a domain controller.

createEventLogEntry()

Creates an event log entry in either the Application, Security or System event log types. You can create a Warning, Error or Informational event with your own description.

createLocalUser()

Adds a new local user account to a machine.

createWindowsFileShare()

Creates a new file share on a Windows machine.

deleteDirectory()

Deletes a directory from the agent machine.

deleteFile()

Deletes a file from the managed machine.

deleteFileInDirectoryPath()

Deletes file in directory returned by getDirectoryPathFromRegistry().

deleteRegistryKey()

Deletes a key from the registry.

delete64BitRegistryKey()

Deletes a 64-bit key from the registry.

deleteRegistryValue()

Deletes a value from the registry.

delete64BitRegistryValue()

Deletes a 64-bit value from the registry.

deleteUser()

Deletes a user from the agent machine.

disableUser()

Disables a user, preventing logon to the agent machine.

disableWindowsService()

Disables a Windows service.

enableUser()

Enables a previously disabled user, allowing the user to logon to the OS.

executeFile()

Executes any file as if it was run from the Run item in the Windows Start menu.

executeFileInDirectoryPath()

Same as execute file. File location is relative to the directory returned by getDirectoryPathFromRegistry().

executePowershell()

Executes a powershell file, or command with arguments or both.

executePowerShell32BitSystem

Executes a powershell file, or command with arguments or both, as a 32 bit system command.

executePowerShell32BitUser

Executes a powershell file, or command with arguments or both, as a 32 bit user command.

executePowerShell64BitSystem

Executes a powershell file, or command with arguments or both, as a 64 bit system command.

executePowerShell64BitUser

Executes a powershell file, or command with arguments or both, as a 64 bit user command.

executeProcedure()

Starts another VSA agent procedure on the current machine.

executeShellCommand()

Runs any command from a command shell.

executeShellCommandToVariable()

Executes a shell command and returns output created during and after its execution to a variable.

executeVBScript()

Runs a Vbscript, with or without command line arguments.

getDirectoryPathFromRegistry()

Returns the directory path stored in the registry at the specified location. Result used in subsequent steps.

getFile()

Gets a file from the managed machine and saves it to the Kaseya Server.

getFileInDirectoryPath()

Gets a file from the managed machine located relative to the directory returned by getDirectoryPathFromRegistry() and saves it to the Kaseya Server.

getURL()

Returns the text and HTML contents of a URL and stores it to a file on the managed machine.

getURLUsePatchFileSource()

Downloads a file from a given URL to a target folder and file for that agent. Uses the Patch Management > File Source settings.

getVariable()

Gets a value from the agent on the managed machine and assigns it to a variable. See Using Variables.

getVariableRandomNumber()

Generates a random number.

getVariableUniversalCreate()

Gets a variable that persists outside of the immediate procedure's execution.

getVariableUniversalRead()

Reads up to three variables you have previously created using the getVariableUniversalCreate() step.

giveCurrentUserAdminRights()

Adds the current user to the local administrator’s group on the agent machine, either permanently or for a temporary period of time.

impersonateUser()

Specifies the user account to use when executing a file or shell when Execute as the logged on user is specified in a subsequent command.

installAptGetPackage()

Silently installs a package using the apt-get command in Linux.

installDebPackage()

Silently installs a Debian package on any Linux OS that supports .deb packages.

installDMG()

Silently installs a .DMG package in OS X.

installMSI()

Installs an MSI file for Windows.

installPKG()

Silently installs a .PKG package in OS X.

installRPM()

Silently installs an RPM package on any Linux OS that supports installing RPMs.

logoffCurrentUser()

Automatically logs off the current user.

pauseProcedure()

Pauses the procedure for N seconds.

reboot()

Reboots the managed machine.

rebootWithWarning()

Reboots a machine, displaying a warning message to the end-user before the reboot process occurs.

removeWindowsFileShare()

Removes a file share from a Windows agent.

renameLockedFile()

Renames a file that is currently in use.

renameLockedFileInDirectoryPath()

Renames a file currently in use in directory returned by getDirectoryPathFromRegistry().

scheduleProcedure()

Schedules an agent procedure to run on a specified machine.

sendAlert()

Creates an alert based on a previous getVariable() command.

sendEmail()

Sends an email to one or more recipients.

sendMessage()

Displays a message in a dialog box on the managed machine.

sendURL()

Opens a browser to the specified URL on the managed machine.

setRegistryValue()

Sets the registry value to a specific value.

set64BitRegistryValue()

Sets the 64-bit registry value to a specific value.

sqlRead()

Returns a value from the database and stores it to a named variable by running a selected SQL "read" statement.

sqlWrite()

Updates the database by running a selected SQL "write" statement.

startWindowsService()

Runs a Start command for a Windows service, if it exists.

stopWindowsService()

Runs a Start command for a Windows service if it exists.

transferFile()

Transfers a file from the agent machine running this step to another agent machine.

uninstallbyProductGUID()

Silently uninstalls a product based on its MSI GUID.

unzipFile()

Extracts the contents of a specified zip file to a target folder.

updateSystemInfo()

Updates the selected System Info field with the specified value.

useCredential()

Specifies that the agent credential should be used when Execute as the logged on user is specified in a subsequent command.

windowsServiceRecoverySettings()

Sets the Service Recovery Settings for any given service in Windows.

writeDirectory()

Writes a directory from the server to the managed machine.

writeFile()

Writes a file stored on the Kaseya Server to the managed machine.

writeFileFromAgent()

Transfers a file from another agent machine to the agent machine running this step.

writeFileInDirectoryPath()

Writes a file stored on the Kaseya Server to the managed machine using the directory returned by getDirectoryPathFromRegistry().

writeProcedureLogEntry()

Writes a string to the Agent Procedure Log.

writeTextToFile()

Writes text to a file on the agent machine.

zipDirectory()

Compresses a directory and any subdirectories or files it contains into a zip file on the agent machine.

zipFiles()

Compresses a single file or files into a zip file on the agent machine.