Manage Learn to apply best practices and optimize your operations.

Retrieval of information from desktop running Notes client

Retrieve info with a script.

This is piece of code which I had written to collect information from 900 and odd desktops spread over different locations. This script will collect the following information from the desktop :
Name of the User
Name of the Machine
I/P of the Machine
Port used for connecting to the Server
O/S running the Notes Client
Mail Template Used
Lotus Notes Version Used
This information is collected from the desktop and deposited in a Notes Database on the server.
This script can be run as an event on the mail template or from a button in a mail, send to the user from Server Administrator.

(code has been line-wrapped for space concerns)


Declare Function GetComputerName& Lib "kernel32" Alias "GetComputerNameA" 
(Byval lpBuffer As String, nSize As Long)

Initialze or Click

	Const NotesMacro$ = "@Platform([Specific])"
	Dim sess As New NotesSession
	Dim db As NotesDatabase
	Dim maildb As NotesDatabase
	Dim nabdb As NotesDatabase
	Dim view As Notesview
	Dim nabview As NotesView
	Dim nabdoc As NotesDocument
	Dim snabdb As NotesDatabase
	Dim snabview As NotesView
	Dim vc As NotesViewEntryCollection
	Dim entry As NotesViewEntry
	Dim snabdoc As NotesDocument
	Dim infodb As NotesDatabase
	Dim serverip, version, platform, template, portname, computername, conplat As String
	x = 1
	Set db = sess.CurrentDatabase
' for getting the IP of Ozzie  	*******************
	Set nabdb = sess.GetDatabase("" , "names.nsf")
	Set nabview =nabdb.GetView("Connections")
	Set nabdoc = nabview.GetfirstDocument
	While Not  (nabdoc Is Nothing)
		If nabdoc.Destination(0) = "grmclna1" Then
			serverip = nabdoc.OptionalNetworkAddress(0)
			portname = nabdoc.PortName(0)
		Elseif nabdoc.Destination(0) = "CN=grmclna1/O=Genesys" Then
			serverip = nabdoc.OptionalNetworkAddress(0)
			portname = nabdoc.PortName(0)
		End If
		Set nabdoc = nabview.GetNextDocument(nabdoc)
' for getting the Notes Version
	version = sess.NotesVersion
' for getting the Operating System
	platform = Evaluate(NotesMacro$)
'	platform = sess.Platform
' for getting the mail template used
	Set snabdb = sess.GetDatabase("grmclna1/Genesys","names.nsf")
	Dim dc As NotesDocumentCollection
	Dim GetPersonDocument As Notesdocument
	Dim cuser, mailfiles As String
	cuser = sess.CommonUserName
	Dim srch As String
	srch = "Form = ""Person"" & @LowerCase(FullName) = """ + Lcase$(cuser) 
+ """"
	Set dc = snabdb.Search(srch, Nothing, 0)
	Set GetPersonDocument = dc.GetFirstDocument
	mailfiles = GetPersonDocument.MailFile(0)
'	mailfiles = Mid$(mailfiles,6,10)
'	mailfiles = mailfiles + ".nsf"
	Set maildb = sess.GetDatabase("Grmclna1/genesys", mailfiles)
	template = maildb.DesignTemplateName
' for name of the computer	
	Dim s$
	Dim dl&
	Dim sz&
	gl& = GetComputerName (s$, sz)
	computername = s$
' create a document in the receving database	
	conplat = platform(0) + "  " + platform(1)
	Set infodb = sess.GetDatabase("grmclna1/genesys", "General/DesktopS.nsf")
	Dim infodoc As New Notesdocument(infodb)
	infodoc.form = "desktopinfo"
	infodoc.username = sess.CommonUserName
	infodoc.machinename = computername
	infodoc.os = conplat
	infodoc.mailtemp = template
	infodoc.version =  version
	infodoc.serverip =  serverip
	infodoc.serverport = portname
	Call infodoc.Save( False, False )
	Messagebox(" You have Successfully updated the Statistics. You may 
proceed to Delete this message now")

Dig Deeper on Domino Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...