This script wil run the command line management interface for the Novell ZENworks Adaptive Agent that is installed on managed devices with the option security-location (sl) and  output the info in a message box.

I have written this script to implement in a installer script to wait until the agent is registered in de ZenWorks Server.

Dim WshShell, oExec, strText, strId, strName, strStream
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec("zac sl")

Do While oExec.StdOut.AtEndOfStream <> True
strStream = trim(oExec.StdOut.ReadLine)

Select Case left(strStream,3)
Case "The"
If strstream = "The current security location is unknown." Then
strStatus = "No Location"
End If
Case "Id:"
strStatus = "Current Security Location:"
strId = strStream
Case "Nam"
strName= strStream
End Select


If strStatus = "Current Security Location:" Then
strText = strStatus & vbcrlf & strId & vbcrlf & strName
strText = "The current security location is unknown."
End If

wscript.echo strText

More Console commands for Zenworks11 can be found here: