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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
 
Loop
 
If strStatus = "Current Security Location:" Then
strText = strStatus & vbcrlf & strId & vbcrlf & strName
Else
strText = "The current security location is unknown."
End If
 
wscript.echo strText

More Console commands for Zenworks11 can be found here:
http://www.novell.com/documentation/zenworks11/pdfdoc/zen11_utils/zen11_utils.pdf