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)

Declarations

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

Initialze or Click

	Const NotesMacro$ = "@Platform([Specific])"
	Const MAX_COMPUTERNAME_LENGTH = 15
	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)
	Wend
'***********************************************************
' 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$
	s$ = String$(MAX_COMPUTERNAME_LENGTH+1, 0)
	Dim dl&
	Dim sz&
	sz& = MAX_COMPUTERNAME_LENGTH+1
	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.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchDataCenter

SearchContentManagement

Close