Jump to content

Novell's Console One

Recommended Posts

My company uses Novell's ConsoleOne to remote control PC's. We currently use a product called ZenBrowser which to say the list isn't always working correctly, yet ConsoleOne is always able to control a PC. With that said I came up with the following code.

Here's what it basically does.

1. Reads three things from "settings.ini"

  • Tree: Novell tree
  • RemoteAgentPassword: Password used by Rconsole to connect
  • NlistQueryName: Container where the workstations are located.
2. At the GUI window you can either "find" it or "remote" it.
  • FindIt: Means you only know the inventory number, but not the full name of the workstation
  • RemoteIt: Means you know the workstations full name.
3. When you click Find it, it will use "nlist" to search the container specified in the "settings.ini" and display the first item. It will prompt you with a message box, then copy the text to the text box with a max chactors of 14 due to our naming convention.

Here's what I need it do possibly do:

When it uses "nlist.exe", it temps the output to a file. I would like to to output the text to a GUI Combo Box if possible, removing any spaces from the file.

Any help would greatly be appreciated.

Here's the Code:

#include <GuiConstants.au3>
AutoItSetOption("TrayIconHide", 1)
$script_title = "Mini Remoter V2"
GuiCreate($script_title, 266, 120, 430,346)
GUISetFont(12, 400, "", "Arial")
$txt_pcname = GuiCtrlCreateInput("Inventory Number Here", 8, 32, 249, 29)
GUICtrlSetLimit(-1, 14)
$btn_findit = GuiCtrlCreateButton("Find It", 56, 64, 97, 25)
$btn_remote = GuiCtrlCreateButton("Remote It", 160, 64, 97, 25)
$Label1 = GuiCtrlCreateLabel("Type in the inventory number Below", 8, 5, 224, 20)
$filemenu = GUICtrlCreateMenu ("&File")
$help = GUICtrlCreateMenuitem ("&Help",$filemenu)
$about = GUICtrlCreateMenuitem ("&About",$filemenu)
$close = GUICtrlCreateMenuitem ("&Exit",$filemenu)
$tree = IniRead("settings.ini", "RCONSOLE", "TREE", "")
$pword = IniRead("settings.ini", "RCONSOLE", "RemoteAgentPassword", "")
$ws_container = IniRead("settings.ini", "RCONSOLE", "WorkStationContainer", "")
$ws_nlist = IniRead("settings.ini", "RCONSOLE", "NLISTQUERY", "")
FileInstall("sscreen.gif", @TempDir & "\sscreen.gif")
$splash = @TempDir & "\sscreen.gif"
While 1
    $msg = GUIGetMsg()
        Case $msg = $btn_findit
            GUICtrlSetState($btn_findit, $GUI_DISABLE)
            $ws = GUICtrlRead($txt_pcname)
            $ws_ip = TCPNameToIP($ws)
            SplashImageOn("Searching, please wait...", $splash, 272, 167, 300, 100, 16)
            $temp = @TempDir & "\temp.txt"
            RunWait(@ComSpec & " /c " & "z:\cx .", "", @SW_HIDE)
            RunWait(@ComSpec & " /c " & "z:\cx ou=" & $ws_nlist, "", @SW_HIDE)
            RunWait(@ComSpec & " /c " & "z:\nlist workstation= *" & $ws & "* > " & $temp, "", @SW_HIDE)
            $file = FileOpen($temp, 0)
            If $file = -1 Then
                MsgBox(0, "Error", "Unable to open " & $temp)
            $line = FileReadLine($file, 1)
            If $line = "No workstation objects were found." Then
                MsgBox(16, "Warning!", $line)
                MsgBox(32, "PC Information", "PC found with the following information:" & @CRLF & $line)
                GUICtrlSetState($btn_findit, $GUI_ENABLE)
                WinSetState($script_title, "", @SW_SHOW)
                ControlSend($script_title, "", "Edit1", ClipGet())
        Case $msg = $btn_remote
            GUICtrlSetState($btn_remote, $GUI_DISABLE)
            $ws = GUICtrlRead($txt_pcname)
            $ws_ip = TCPNameToIP($ws)
            $ws = GUICtrlRead($txt_pcname)
            $ws_ip = TCPNameToIP($ws)
            $run_line = 'RCConsole -n"' & $tree & '" -c"Remote Control" -t"0" -s"2" -a"' & $ws_ip & '" -p"' & $pword & '" -w"' & $ws & $ws_container & '"'
            RunWait(@ComSpec & " /c " & $run_line, "", @SW_HIDE)
            GUICtrlSetState($btn_remote, $GUI_ENABLE)
        Case $msg = $help
            MsgBox(64,"Help","No help Information at this time. Call Bill Bunnhummer for assistance at 1-800-132-1234.")
        Case $msg = $about
            MsgBox(64,"About","Program is used as a replacement for ZenBrowser." & @CRLF & "It uses ConsoleOne Components to remote control the workstation.")
        Case $msg = $close
        Case $msg = $GUI_EVENT_CLOSE
        Case Else
Func _errorCtl();This is used for error control. 
If UBound(ProcessList(@ScriptName)) > 2 Then 
    $run2 = Msgbox(164,"Warning","Application is already running!")
$error_1 = FileExists("settings.ini")
If $error_1 = "0" Then
    MsgBox(16,"Warning!",'Please make sure "setting.ini" is in the same directory as ' & @ScriptName)

Here's what the settings.ini looks like.

[RCONSOLE];What tree it should use.


;The remote Agenet Password


;Full path from root. This is used for Nlist to query for workstation


Tree: Novell tree

RemoteAgentPassword: Password used by Rconsole to connect

NlistQueryName: Container where the workstations are located.

Here's what the Nlist query looks like when temped to a file.

*There are spaces between the name and "workstation"

Current context: workstations.chc

Partial Name Object Class


ASW-WS-30876 Workstation

ERD-SP-30878 Workstation

FRC-SP-30879 Workstation

HLB-SP-30879 Workstation

ITS-CP-30877 Workstation

MCR-SP-30870 Workstation

MCR-SP-30873 Workstation

MCR-SP-30874 Workstation

SEC-MP-30870 Workstation

ZFD-CP-30871 Workstation

A total of 10 workstation objects was found in this context.

A total of 10 workstation objects was found.

Edited by kpu
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...