Get custom inventory for unit
Description
Section titled “Description”Gets custom inventory for a specified unit.
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”GetCustomInventoryForUnit(Byval UnitName as String, Byval UnitType as String) as ArrayList
GetCustomInventoryForUnitUUID(Byval Uuid as String) as ArrayList
Parameters
Section titled “Parameters”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
Return value
Section titled “Return value”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.
Example (UnitName and UnitType)
Section titled “Example (UnitName and UnitType)”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 itemnextExample (Uuid)
Section titled “Example (Uuid)”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 itemnext