Du kannst dir eine Liste aller am Server angemeldeten User über den Konsolenbefehl "sh user" ausgeben lassen.
Das kannst du an der Konsole manuell machen oder über Script
Die API und die Klasse kopierst du in die Declaration - Section deines Agenten oder Buttons.
Declare Function NSFRemoteConsole Lib "NNotes.dll" Alias "NSFRemoteConsole" (Byval Server As String, Byval cmd As String, ret As Long) As Long
Declare Function OSLockObject Lib "NNotes.dll" Alias "OSLockObject" (Byval Handle) As String
Declare Sub OSUnlockObject Lib "NNotes.dll" Alias "OSUnlockObject" (Byval Handle)
Declare Sub OSMemFree Lib "NNotes.dll" Alias "OSMemFree" (Byval Handle)
Class remoteConsole
Private IsError As Variant
Private rc As Integer
Private hBuffer As Long
Private Server As String
Private Command As String
Private Result As String
Sub New(inpServer As String)
Dim server As New NotesSession
If inpServer = "" Then
Me.IsError = True
Else
Me.server=inpServer
Me.IsError = False
End If
End Sub
Function Execute(inpCommand As String) As String
If Me.Server = "" Then
Exit Function
End If
If inpCommand = "" Then
Me.execute="You must specify a command"
Me.iserror = True
Exit Function
Else
Me.command = inpCommand
End If
Me.rc = NSFRemoteConsole(Me.server, Me.command, hBuffer)
If Me.rc <> 0 Then
Me.iserror = True
Me.result="Error returned " & _
" from console [" & Cstr(rc) & "]"
Else
Me.result = OSLockObject(hBuffer)
Call OSUnlockObject(hBuffer)
Call OSMemFree(hBuffer)
Me.Iserror = False
End If
Me.execute = Me.result
End Function
End Class
Sub Click(Source As Button)
Dim exec As String
Dim dummy As Variant
Dim remConsole As New RemoteConsole ( "comm1/witte/de" ) ' hier den eigenen Server eintragen
Exec = "sh user" ' welche Konsolenkommando ??
If exec = "" Then
Exit Sub
Else
dummy = remConsole.Execute(exec) ' Kommando ausführen
Msgbox dummy ' Rückgabewert steht in dummy
End If
End Sub
In der Varaiblen dummy hast du dann die Liste der User. Diese musst du dann nur noch entsprechend aufbereiten.
Ulrich