Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

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

(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)

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

(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

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

(blue star) PowerShell

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

Scripting Guidelines

Related functions

CMS_AddHardwareInventory

CMS_AddCustomInventory

  • No labels