Set custom inventory
Description
Section titled “Description”Sets a custom inventory value for a unit. If the section and name don’t exist in custom inventory yet, they’re created.
Syntax
Section titled “Syntax”Two functions are available. Use the one that matches how you identify the unit.
UnitName and UnitType
Section titled “UnitName and UnitType”SetCustomInventory(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
SetCustomInventoryUUID(Byval Uuid as String, Byval Section as String, Byval Name as String, Byval Value as String, Byval DataType as String) as Boolean
Parameters
Section titled “Parameters”UnitName (String)
The name of the unit to set custom 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, for example:
- “1” or “Computer”
- “2” or “User”
- The Id or name of another unit type, for example a custom device type
Uuid (String)
The UUID of unit to set custom 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).
Return value
Section titled “Return value”Boolean. Returns True if the value is set, otherwise False. If the unit isn’t found, the function raises an error.
Example
Section titled “Example”Set oCMS = CreateObject("CapaInstaller.SDK")wscript.echo oCMS.SetInstanceManagementPoint("1")wscript.echo oCMS.SetCustomInventory("Klient","1","Antivirus","Version","4","I")Set oCMS = CreateObject("CapaInstaller.SDK")wscript.echo oCMS.SetInstanceManagementPoint("1")wscript.echo oCMS.SetCustomInventoryUUID("E3FBEC1E-32AC-4E51-AB9F-A644CD9F0A6B", "Antivirus","Version","4","I")