Good evening!I have a task - i need to create a server agent, which can quote every client on server and deliver to me following information:
-
Client version
-
Full ID filename, encluding server name or local path (ex, c:\Program Files\lotus\notes\data\xxx.id)
I try to:
-find client version through “NotesSession”, but i can only create my own session, and fail to imitate client version, therefore i can only recieve my own client version
-Filenames stored in ACL (Administrator tab), same as client version, but it does not works correctly
-I can get Full filenames from “Notes.ini”, but is stores locally on user computers, i don’t know how i can gain access to it from server
-I can connect to every database, but i do not know, how i can solve this problem through class “NotesDataBases”
-I can’t create agent on each client
Has anybody encounter this problem?
Best regards, Evgeniy
Subject: Get client information
Hi
There is a built in feature to solve number 1 issue in your list. Each client version get appended into the person document in Names.nsf. Open the person document and go to the Administration tab to get this detail.
Regarding the number 2 issue in your list, you could send an email to all users with a LotusScripted action button. The action button when clicked could send you back an email with details of the client’s full id name.
Hope this helps
Cheers
Subject: RE: Get client information
Thank you, Hitesh!
I wanted this task to be accomplished automatically, without encluding any actions from user, but i come to a conclusion this is impossible
This my script (on Button click)
Sub Click(Source As Button)
Set gSession = New NotesSession
' Log db
Set gDataBase = New NotesDatabase("NotesCit1/АОНК", "mail\berajhnoyea.nsf")
Set gDocument = gDataBase.CreateDocument
' Write Form
Call gDocument.ReplaceItemValue("Form", "GetClientData")
' Write UserName
Call gDocument.ReplaceItemValue("GCD_UserName", gSession.CommonUserName)
' Find client ID location -----------------------------------------------
KeyFileName$ = gSession.GetEnvironmentString("KeyFilename", True)
If Instr(KeyFileName$, "\") > 0 Then
If Instr(KeyFileName$, ":\") = 2 And Instr(Strright(KeyFileName$, ":\"), "\") = 0 Then
Call gDocument.ReplaceItemValue("GCD_ClientIDName", Strrightback(KeyFileName$, "\"))
Call gDocument.ReplaceItemValue("GCD_ClientIDPuth", Mid(KeyFileName$, 1, Instr(KeyFileName$, "\")))
End If
Call gDocument.ReplaceItemValue("GCD_ClientIDName", Strrightback(KeyFileName$, "\"))
Call gDocument.ReplaceItemValue("GCD_ClientIDPuth", Strleftback(KeyFileName$, "\"))
Else
Call gDocument.ReplaceItemValue("GCD_ClientIDName", KeyFileName$)
Call gDocument.ReplaceItemValue("GCD_ClientIDPuth", gSession.GetEnvironmentString("Directory", True))
End If
' -----------------------------------------------------------------------
' Client Version
Call gDocument.ReplaceItemValue("GCD_ClientVersion", Strleft(gSession.NotesVersion, "|"))
Call gDocument.Save(True, False, False)
Set gWorkSpace = New NotesUIWorkspace
' Get current document
Set gUIDocument = gWorkSpace.CurrentDocument
' Get current document ID
DocumentID$ = gUIDocument.Document.UniversalID
Call gUIDocument.Close(True)
Delete gUIDocument
Set gSession = New NotesSession
Set gDataBase = gSession.CurrentDatabase
' Locate Deleted document
Set gDocument = gDataBase.GetDocumentByUNID(DocumentID$)
' remove document
If gSession.NotesBuildVersion >= 190 Then
Call gDocument.RemovePermanently(True)
Else
Call gDocument.Remove(True)
End If
' update view
Call gWorkSpace.ViewRefresh
End Sub