Skip to content

Get software inventory for unit

Gets software inventory for a specific computer or user.

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

UnitName (String)

Name or UUID of the unit to retrieve inventory for

UnitType (String)

Type of the unit. You can use the Id or the name of the unit type. If UnitName is a UUID, UnitType is ignored.

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

The function returns an array of Software Inventory items. Each element (inv) in the array is a joined line with the character defined with Set splitter.

  • inv.Software.Name
  • inv.Software.Version
  • inv.InstallDate
  • inv.Software.MeteringModule (always empty)
  • inv.Software.AppCode
  • inv.Software.Description
  • inv.Software.ID
  • inv.Software.Vendor

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.GetSoftwareInventoryForUnit("E3FBEC1E-32AC-4E51-AB9F-A644CD9F0A6B","1")
for each item in aUnit
wscript.echo item
next