Jump to content

Novell's Console One


kpu
 Share

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)
;-----------------------------------------------------------------------------------------------
_errorCtl()
;-----------------------------------------------------------------------------------------------
$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)
;-----------------------------------------------------------------------------------------------
GUICtrlCreateMenu("Information",300,200)
$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"
;-----------------------------------------------------------------------------------------------
GuiSetState()
While 1
    $msg = GUIGetMsg()
    Select
        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)
                Exit
            EndIf
            $line = FileReadLine($file, 1)
            SplashOff()
            If $line = "No workstation objects were found." Then
                MsgBox(16, "Warning!", $line)
            Else
                MsgBox(32, "PC Information", "PC found with the following information:" & @CRLF & $line)
                GUICtrlSetState($btn_findit, $GUI_ENABLE)
                ClipPut($line)
                FileClose($file)
                WinSetState($script_title, "", @SW_SHOW)
                ControlSend($script_title, "", "Edit1", ClipGet())
            EndIf
        Case $msg = $btn_remote
            GUICtrlSetState($btn_remote, $GUI_DISABLE)
            $ws = GUICtrlRead($txt_pcname)
            $ws_ip = TCPNameToIP($ws)
            TCPStartup()
            $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
            ExitLoop
   ;---------------------------------------------------------------------------------------
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case Else
       ;;;
    EndSelect
WEnd
Exit
;-----------------------------------------------------------------------------------------------
Func _errorCtl();This is used for error control. 
If UBound(ProcessList(@ScriptName)) > 2 Then 
    $run2 = Msgbox(164,"Warning","Application is already running!")
Exit
Else
EndIf
$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)
    Exit
EndIf
EndFunc

Here's what the settings.ini looks like.

[RCONSOLE];What tree it should use.

TREE=KIDS

;The remote Agenet Password

RemoteAgentPassword=npgb

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

NLISTQUERY=workstations

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 comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...