Get Unit Relations
Description
Gets the unit relations of a specified unit. These include Primary, Default, Current, previously logged on, and manually linked units.
Syntax
GetUnitRelations(ByVal unitName As String, ByVal unitType As String) As ArrayList
Parameters
UnitName (String)
The name of the unit, or the uuid of the unit.
UnitType (String)
Type of Unit
"Computer"
"User"
Return Value
The function returns an array of units. Each unit (unit) in the array is a joined line with the character defined with Set splitter.
Relation type ("Primary User"/"Current User"/"Default User"/"Manually Created"/"Previously logged on User")
unit.Name
unit.Created
unit.LastExecuted
unit.Status
unit.Description
unit.GUID
unit.ID
unit.Type.Name
unit.UUID
Is mobile ("True"/"False)
unit.location
unit.CmpId
unit.BuId
Example
VBScript
Set oCMS = CreateObject("CapaInstaller.SDK")
Set arrRelations = CreateObject("System.Collections.ArrayList")
Wscript.echo oCMS.SetDefaultManagementPoint("1")
Set arrRelations = oCMS.GetUnitRelations("Klient","Computer")
For Each item In arrRelations
Wscript.echo item
arr=Split(item,"|")
Wscript.echo "Relation type: " & arr(0)
Wscript.echo "Name: " & arr(1)
Wscript.echo "Location: " & arr(11)
Wscript.echo "Status: " & arr(4)
Wscript.echo "***************************"
Next