CMS\_GetInventory
Description
Section titled “Description”Gets inventory values from the database, from either the Hardware, Custom, or Logon inventory tables.
| Please note, that this is an expensive call, seen from the Frontend/database perspective. Calling this function repeatedly from a package could result in overall slower performance. This function should be used with care. |
Syntax
Section titled “Syntax”:vb: CMS_GetInventory(table, category, entry) As string
:ps: [string]CMS_GetInventory -table <string> -category <string> -entry <string>
Parameters
Section titled “Parameters”table (string)
Table (string)
This is the table toward which the request is made, and it can be either HWI (hardware inventory), LGI (logon inventory), or CSI (custom inventory).
category (String)
Category name
entry (String)
variable name
Return value
Section titled “Return value”:vb: The function returns a boolean (bStatus), indicating if the call was successful. The requested value will be stored in gsValue.
:ps: Result will be returned as the result of the function.
Example
Section titled “Example”:vb: VBScript
java<br/>If bStatus Then bStatus = CMS_GetInventory("hwi", "System", "Name")<br/>If bStatus Then bStatus = Job_WriteLog("System", "Name: " & gsValue, bStatus, True)<br/> |
:ps: PowerShell
powershell<br/>$systemname = CMS_GetInventory -table "hwi" -category "System" -entry "Name"<br/>$cs.Job_WriteLog("System name: $systemname")<br/> |
Related functions
Section titled “Related functions”