AddListItem

AddListItem is a function which allows scripts to return feedback to the user. This function will add any string passed to it as a sub node of the triggered vulnerability. The AddListItem function takes 2 different parameters. The first parameter specifies the parent node and the second parameter, the string to be added to the tree. If the parent node is left empty, the function will add the specified string to the top available node (the vulnerability parent node). The tree can only have 1 level though even though it can have as many siblings as required.

Syntax

AddListItem(String,String)

Returns

N/A.

Example
Function MAIN
     Dim wmi As Object
     Dim objset As Object
     Dim obj As Object
     Dim monitor As Object
     Dim prop As Object
     Set wmi = GetObject("winmgmts:\\127.0.0.1\root\cimv2")
     Set objset = wmi.instancesof("Win32_service")
     For Each obj In objset
          Set monitor = obj
          For Each prop In monitor.properties_
               If VarType(prop.value) = 8 Then
               If Not (IsNull(prop.value)) Then
               If prop.name = "Name" Then
               If left(prop.value,1) = "a" then
                    AddListItem("A",prop.value)
               End If
               If left(prop.value,1) = "b" then
                    AddListItem("B",prop.value)
               End If
               If left(prop.value,1) = "c" Then
                    AddListItem("C",prop.value)
               End if
               End If
               End If
               End If
          Next
          Next
     main = true
End Function