Skip to content

Get logon history for unit

Gets a list of logon history information for a specific unit.

GetLogonHistoryForUnit(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 Logon Inventory items. Each element (inv) 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
Set oCMS = CreateObject("CapaInstaller.SDK")
Set aUnit = CreateObject("System.Collections.ArrayList")
wscript.echo oCMS.SetInstanceManagementPoint("1")
Set aUnit = oCMS.GetLogonHistoryForUnit("Klient","1")
for each item in aUnit
wscript.echo item
next