You need to look at the CGI-variable Remote_User. Have a look in the Lotus Design help for "Table of CGI variable names."
If this is in a WebQueryOpen agent, userName will hold the authenticated name:
Dim session As New NotesSession Dim doc As NotesDocument Dim userName As String Set doc = session.DocumentContext userName = doc.Remote_User(0)If you don't absolutely have to use LotusScript, there is a @Function that retrieves the name from the CGI-variable: @GetHttpHeader("Remote_User")
I think you have totally missed the question with your answer. The CGI-variable Remote_User is showing only one user -- the single active user in the Web browser, and not all users that have been authenticated on the server (as the person asking the question was aiming at).
So, back to the original question: Is there a way to use LotusScript to write and read the results of admin console commands (not only 'Tell HTTP show users' but other commands as well)?
— Kenneth A.
You are absolutely right -- I misunderstood the question. So here's another try.
I haven't heard of a way of tapping what is on the server console, but I have a different idea. First, here's a comment on the tell HTTP show users command:
If it was possible to tap what you get when you do a tell HTTP show users, you might have a problem because this information is per hostname. If your application is the only one running from a certain hostname, this would of course not be a problem.
Now, on to my idea. It requires you to be running the Domino server on Win32. In the Sandbox on what's it's name (I still can't find out what that place that was formerly known as notes.net is called), there is an excellent class available for accessing user activity. It's called NotesUserActivity class (http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/c12a2fd2142758b68525688d00708397?OpenDocument).
User activity is what you see if you (from the Notes client) get the database property box, second tab, then click "user detail." It tells you that user x read y documents at a certain time, and it holds a log of at least a month back (this is probably controlled by a notes.ini setting). This user activity log also holds activity for Web users.
My suggestion would be to create an agent that taps this information when needed. I don't know what you want to use the information for, so I can't be more specific as to how exactly you should go about using this class, but I'm sure that you should be able to work something out. It is my impression that the log only holds information about documents being read, so displaying a view will not be in the log. Also, the log is not updated the moment that someone reads a document -- there is a small lag (up to about one minute from my observations).
Do you have comments on this Ask the Expert question and response? Let us know.
Dig Deeper on LotusScript
Related Q&A from Jens Bruntt
Learn about an add-on Domino developers can use to programmatically edit rich-text field tables from within the Lotus Notes client. Continue Reading
Web Development expert Jens Bruntt outlines three potential issues to consider when troubleshooting Lotus Notes Domino tabbed table problems. Continue Reading