getVariable()
NOTE This command includes a 64-bit Registry Value
parameter. See 64-Bit Commands.
Defines a new agent variable. When the procedure step executes, the system defines a new variable and assigns it a value based on data fetched from the managed machine's agent.
NOTE See Using Variables for the types of variable values supported by the getVariable() command.
NOTE A file size limit of 25 MB is allowed when defining a file path. If the referenced file exceeds the limit, the agent procedure will fail to run. The file size limit will be reported in logs under Quick View > Procedure Logor Agent Logs > Agent Admin Logs > Procedure History.
Examples
Store a registry value.
getVariable("Registry Value", "HKEY_CURRENT_USER\KaseyaAgent-HKCUTest\TestREG_SZ", "regSZ", "All Operating Systems", "Halt on Fail")
Store the contents of an ASCII text file (Unicode file formats are not supported).
getVariable("File Content", "#systemdrive#\temp\degrag.txt", "defrag", "All Operating Systems", "Halt on Fail")
Store a database view.
getVariable("SQL View Data", "vMachine/IpAddress", "ipaddress", "All Operating Systems", "Halt on Fail")
Store a WMI value.
getVariable("WMI property", "root\cimv2:Win32_OperatingSystem.FreePhysicalMemory", "freememory", "All Operating Systems", "Halt on Fail")
Store the agent install drive.
getVariable("Agent Install Drive (C:\)", " ", "agentDrv", "All Operating Systems", "Halt on Fail"
Store the agent working directory path.
getVariable("Agent Working Directory Path", " ", "agentWorkDir", "All Operating Systems", "Halt on Fail"
Store the secure agent working directory path. This is sub-directory of the agent working directory called “System” with ACL permissions restricted to System account and Administrators. It should be used for saving executable files or any data files containing sensitive information.
getVariable("Secure Agent Working Directory Path", " ", "agentWorkDir", "All Operating Systems", "Halt on Fail"
Prompt the user to enter a value when the procedure is scheduled.
getVariable("Prompt When Procedure is Scheduled", "URL:", "site", "All Operating Systems", "Halt on Fail"