Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

This function should be used with care.

 

Syntax

(blue star) CMS_GetInventory(table, category, entry) As string

(blue star) [string]CMS_GetInventory -table <table> -category <category> -entry <entry>

Parameters

table (string)

Table (string)

...

variable name

Return value

(blue star) The function returns a boolean (bStatus), indicating if the call was successful. The requested value will be stored in gsValue.

(blue star) Result will be returned as the result of the function.

Example

(blue star) VBScript

Code Block
If bStatus Then bStatus = CMS_GetInventory("hwi", "System", "Name")
If bStatus Then bStatus = Job_WriteLog("System", "Name: " & gsValue, bStatus, True)

(blue star) PowerShell

Code Block
languagepowershell
$systemname = CMS_GetInventory -table "hwi" -category "System" -entry "Name"
$cs.Job_WriteLog("System name: $systemname")

Scripting Guidelines

Related functions

https://capasystems.atlassian.net/wiki/spaces/CI65DOC/pages/19382166654

https://capasystems.atlassian.net/wiki/spaces/CI65DOC/pages/19382166618 CMS_AddHardwareInventory

CMS_AddCustomInventory