Skip to content

Set hardware inventory

Sets a hardware inventory value for a unit.

Two functions are available. Use the one that matches how you identify the unit.

SetHardwareInventory(Byval UnitName as String, Byval UnitType as String, Byval section as String, Byval Name as String, Byval Value as String, Byval DataType as String) as Boolean

SetHardwareInventoryUUID(Byval Uuid as String, Byval Section as String, Byval Name as String, Byval Value as String, Byval DataType as String) as Boolean

UnitName (String)

The name of the unit to set hardware inventory for. You can also specify the UUID of the unit. The UnitType is then ignored.

UnitType (String)

The type of unit stated in UnitName. You can use the Id or the name of the unit type:

  • “1” or “Computer”
  • “2” or “User”

Uuid (String)

The UUID of unit to set hardware inventory for in the format; xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Section (String)

Inventory section

Name (String)

Name of the value

Value (String)

The value itself

DataType (String)

The type of data being inserted;

  • “I” = Integer
  • “T” = Time
  • “S” = String
  • “N” = Text

Any other value is treated as “S” (String).

Boolean. Returns True if the value is set, otherwise False. If the unit isn’t found, the function raises an error.

Set oCMS = CreateObject("CapaInstaller.SDK")
wscript.echo oCMS.SetInstanceManagementPoint("1")
wscript.echo oCMS.SetHardwareInventory("Klient","1","Section","Name","Value","S")
Set oCMS = CreateObject("CapaInstaller.SDK")
wscript.echo oCMS.SetInstanceManagementPoint("1")
wscript.echo oCMS.SetHardwareInventory("E3FBEC1E-32AC-4E51-AB9F-A644CD9F0A6B","1","Section","Name","Value","S")