Automatically Connecting Domino Console to Many Domino Servers
Web Doc
Note: This is publication is now archived. For reference only.
Domino 6 contains a new tool to monitor and administer a Lotus Domino server: the Domino Console. In contrast to the well-known Administrator Client, Domino Console allows you to connect to more than one server at the same time. However, it does not allow you to automate the logon process. Therefore, if you need to connect to many Domino servers, such as after restarting a z/OS or z/VM system, you have to enter a lot of user IDs, passwords, and server names, for example.
This Technote explains how to automate this process. It's as simple as building a configuration file with the information for your Domino servers and running the script that is provided. For additional questions, contact Dr. Andreas Gallus of IBM Germany at a.gallus@de.ibm.com.
Domino Controller is new Java code that you can use to start the Domino 6 server. It intercepts the output from the server and writes it to any connected Domino Consoles. Optionally, the Domino Controller writes the output to log files on the server rather than to the server's standard output location (usually the screen).
Domino Console is a new Java-based graphical user interface (GUI) that an administrator can use on a local machine to connect to a Domino 6 server that is run by a Domino Controller, even to a server that is not responding to Notes clients. From Domino Console, administrators securely send commands to be executed either in the Domino server or natively, by the operating system. The Domino Console functions strictly as a server console. You can use it to connect to a Domino Controller to monitor and issue commands to the server. However, it does not include the full set of Domino administration features that are available with the Domino Administrator and the Web Administrator. Nor can you use it to open and manage Notes databases.
You can also use Domino Console as an alternate, secure way to connect to a system running Domino. It offers the ability to issue shell or controller commands.
The built-in capabilities of the Domino Console to connect or disconnect a Domino Controller are fine for reaching a small number of servers. However, if an administrator needs to connect to many servers at the same time, for example after an initial program load (IPL) of a z/VM system running dozens of Linux and Domino servers, you want a more sophisticated way than to manually open the connecting window and type a user ID, password, and server name.
This short script helps to solve this problem. The script is written in Microsoft Visual Basic and runs under Windows Script Host.
Windows Script Host
Windows Script Host is ideal for non-interactive scripting needs, such as logon scripting, administrative scripting, and machine automation. Windows Script Host is a Windows administration tool. It creates a runtime environment for scripts. That means that Windows Script Host plays the part of the host; it organizes objects and services available for the script and provides a set of guidelines within that define the environment where the script is executed. Also Windows Script Host handles security issues and invokes the appropriate script engine. Some examples where Windows Script Host scripts can be useful include creating user and group accounts, automating system backups or other repetitive tasks, and managing Windows services.
Windows Script Host objects and services
The script
---------------------------- domcon.vbs ---------------------------------------
Dim Wsh, fs, ts, filename, filepath, jconsole, jconsole_name
Dim i, parms(3), s, st, sl, position, box
'*** Define the constants used in this script ***
Const separator = " " '*** separator character used in config. file ***
Const comment = "#" '*** comment character used in config. file ***
Const ForReading = 1 '*** file mode ***
'*** Define default path and name of the configuration file ***
filepath = "C:\domcon\"
filename = "domcon.cfg"
'*** Define path and name of DominoConsole programm ***
jconsole = "C:\Lotus\notes\jconsole.exe"
'*** Define the window caption of the Domino Console window ***
jconsole_name = "Lotus Domino Console"
'*** Initiate the objects needed in this script ***
Set fs = CreateObject( "Scripting.FileSystemObject")
Set Wsh = Wscript.CreateObject( "Wscript.Shell")
‘*** Ask for the filename of the configuration file ***
filename = InputBox( "Enter the name of the configuration file.”, “Configfilename ?")
filename = filepath + filename
Set ts = fs.OpenTextFile( filename, ForReading)
'*** Print warning not to use mouse and keyboard during the script ***
box = MsgBox( "Please do not use the keyboard or mouse during the script", 4128, "Important Notice!")
'*** Check if Domino Console runs, if not: ***
'*** start the Domino Console, give it time to initialize ***
'*** In any case: bring the Console window to front ***
If( Not Wsh.AppActivate( jconsole_name)) Then
Wsh.Exec( jconsole) :
WScript.Sleep 6000 :
Wsh.AppActivate jconsole_name :
End If
WScript.Sleep 1000
'*** Read the config file line by line till EOF ***
Do While Not ts.AtEndOfStream
s = ts.ReadLine
sl = Len( s)
i = 1
k = 1
Position = 1
'*** split the line into servername, username, passwort ***
Do While k < 3
Do While i < sl
st = Mid( s, i, 1)
If( st = separator) Then
Exit Do
End If
i = i + 1
Loop
parms( k) = Mid( s, position , i - position)
position = i + 1
i = i + 1
k = k + 1
Loop
parms( 3) = Mid( s, position)
st = Mid( s, 1, 1)
'*** If first charakter indicates a line with comment - ignore it ***
If( Not st = comment) Then
'*** Send the OPEN NEW SERVER command to DominoConsole and ***
'*** send all the expected parameters (server, user, passwort)***
Wsh.SendKeys "^o" :
WScript.Sleep 2000 :
wsh.SendKeys parms( 2) :
WScript.Sleep 500 :
wsh.SendKeys "{TAB}" :
wsh.SendKeys parms( 3) :
WScript.Sleep 500 :
wsh.SendKeys "{TAB}+{END}{BS}" :
WScript.Sleep 500 :
wsh.SendKeys parms( 1) :
WScript.Sleep 500 :
wsh.SendKeys "{TAB}{TAB}{ENTER}" :
WScript.Sleep 6000 :
End If
Loop
'*** Close the configurations file and finish the script ***
ts.Close
box = MsgBox( "Script has finished the keyboard is yours again ...", 64, "everything is fine")
------------------------------------------------------------------------------
The configuration file
Here is an example of a configuration file:
---------------------------- domcon.cfg ---------------------------------------
#Server_name User_name Password
#127.0.0.1 admin password
server1 admin1 password1
server2 admin2 password2
server3 admin3 password3
# This is a comment.
--------------------------------------------------------------------------------
The configuration file is read line by line. If the first character is the pound symbol (#), then the rest of the line is ignored. Each line defines one server connection. Parameters are separated by a space ( ). The first parameter is the server name, the second is the user ID, and the last one is the password for this server-user combination. The characters used as a separator and comment indicator can be defined in the script using the separator and comment variables.
Note: The passwords are stored in clear text inside the configuration file. Therefore, we recommend that you place this script only on machines that are physically protected and accessed only by authorized personnel. This is true for a workstation that serves as a console machine in the operating room.
Summary
Although it is just a small tool, here are some ideas for future improvements:
Appendix: Related publications
Windows Script Host
To download the official Help file from Microsoft for Windows Script Host, go to:
For more information about Windows Script Host and the use of scripts for Windows operating systems, see:
http://www-12.lotus.com/ldd/doc/domino_notes/6.5.1/help65_admin.nsf/Main?OpenFrameSet
The material included in this document is in DRAFT form and is provided 'as is' without warranty of any kind. IBM is not responsible for the accuracy or completeness of the material, and may update the document at any time. The final, published document may not include any, or all, of the material included herein. Client assumes all risks associated with Client's use of this document.