Skip to content

Get custom inventory for unit

Gets custom inventory for a specified unit.

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

GetCustomInventoryForUnit(Byval UnitName as String, Byval UnitType as String) as ArrayList

GetCustomInventoryForUnitUUID(Byval Uuid as String) as ArrayList

UnitName (String)

The name of unit to get 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 name or the Id of the unit type:

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

Uuid (String)

The uuid of unit to get custom inventory for in the format; xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

The function returns an array of custom inventory. Each element in the array is a joined line with the character defined with Set splitter.

  • inv.Category
  • inv.Entry
  • inv.Value
  • inv.Datatype
  • inv.GUID
  • inv.ID

If the unit isn’t found, the function raises an error.

Set oCMS = CreateObject("CapaInstaller.SDK")
Set aUnit = CreateObject("System.Collections.ArrayList")
wscript.echo oCMS.SetInstanceManagementPoint("1")
Set aUnit = oCMS.GetCustomInventoryForUnit("Klient","User")
for each item in aUnit
wscript.echo item
next
Set oCMS = CreateObject("CapaInstaller.SDK")
Set aUnit = CreateObject("System.Collections.ArrayList")
wscript.echo oCMS.SetInstanceManagementPoint("1")
Set aUnit = oCMS.GetCustomInventoryForUnitUUID("E3FBEC1E-32AC-4E51-AB9F-A644CD9F0A6B")
for each item in aUnit
wscript.echo item
next