How to get the user not loging in or accessing their mailbox for x number of days(week,month) in LN

Posted on 2006-05-10
Last Modified: 2013-12-18
Hi experts,

We want to generate a reports containing the list of LN user that are not logging in or Accessing their mailbox for x number of days, we need this report for our audit requirements.


Question by:amd1979
    LVL 63

    Expert Comment

    I do not think that Notes tracks Login information normally.

    You might check the Catalog file as a start.

    Other option may be to increase the logging level and then have an agent pull login information to a file.

    If you have multiple servers this can be a real issue.

    Other options are to use an agent to check when the last time a message was sent.

    What version are you using ?

    I hope this helps !
    LVL 14

    Accepted Solution


    Author Comment

    LVL 18

    Expert Comment

    I used cezarf's with an agent in a separate database to monitor tracking.

    Author Comment


    How about if the admin didnt enable the activity logging?

    marilyng, can you provide me the agent?

    thanks for the help guys

    LVL 18

    Assisted Solution

    In the log.nsf on each server by user will tell you who logged on when and what they did once they logged on.  This is a bit different from the Database logging, which you have to turn on, and which collects back and front end reads and writes.    The server log will tell you if they connected to a database, with 0 reads, 0 writes, etc.  So, someone with replication turned on every 5 minutes will have a lot of these entries, but not necessarily read and write ones.  At any rate, I created a logreports.nsf for the purpose of checking on people, and administration ID use.   I ran this locally and collected the stats from 3 servers.  The code may wrap funny...:)

    'Scheduled: Agent for logreports.nsf:

    Option Public
    Option Explicit
    Sub Initialize
          Dim session As New NotesSession
          Dim db As NotesDatabase
          Set db = session.currentdatabase      
          Dim doc As NotesDocument
          Dim br As String, tb As String, q As String
          Dim thisStart As NotesDateTime
          Dim thisEnd As NotesDatetime
          Dim thisUser As NotesName
          br = Chr(10)
          tb = Chr(9)
          q = Chr(34)
          Dim count As Integer
          Dim agentLog As New NotesLog("Agent log")
          Call agentLog.OpenAgentLog
          On Error Goto HandleError
          Dim rtitem As NotesRichTextItem
          Dim richStyle As NotesRichTextStyle
          Set RichStyle = Session.CreateRichTextStyle
          RichStyle.NotesFont = FONT_HELV
          RichStyle.FontSize = 9
          RichStyle.NotesColor = COLOR_DARK_BLUE
          Dim serverlist(2) As String
          serverlist(0) = "SERVER01/SERVERS"
          serverlist(1) = "SERVER02/SERVERS"
          serverlist(2) = "SERVER03/SERVERS"
          'The Name of the Log on each sesrver
          Const targetdbstr = "log.nsf"
          Const targetformstr="Session"
          Const targetviewstr="Sample Billing"
          Dim targetdb As NotesDatabase, targetview As notesview, targetdoc As Notesdocument
          Dim vcoll As NotesDocumentCollection, starttime As NotesDateTime, n As Integer
          Dim item As NotesItem, tItem As NotesItem, j As Integer
          Dim view As NotesView
          Set view = db.getview("bdl")
          If view Is Nothing Then
                Print "Unable to find lookup view.. exiting"
                Exit Sub
          End If
    'This is meant to monitor people every day, so
    'you can add or remove names to this list and run scheduled
    'If you add names, then add more dimensions to the array

          Dim nameList(2) As String
          nameList(0) = "Fist Person/OU/O"
          nameList(1) = "Second Person/OU/O"
          nameList(2)="Third Person/OU/O"
          For n = Lbound(nameList) To Ubound(nameList)
                Set thisStart = New NotesDateTime(Format(Now(), "mm/dd/yyyy") + " 12:01 AM")
                Set thisUser = New NotesName(nameList(n))      
                Set doc = view.getdocumentbykey(Ucase(thisStart.dateOnly + thisuser.common), True)            
                If doc Is Nothing Then
                      Set doc = New NotesDocument(db)
                End If
                With doc
                      .form = "Log Summary"                  
                      .logdate = thisStart.lslocaltime
                      .username = thisuser.abbreviated
                End With      
                With doc
                      .reads = 0
                      .writes = 0
                      .Transactions = 0
                End With
                Set item = doc.getfirstitem("Body")
                If Not item Is Nothing Then
                End If
                Set rtitem = New NotesRichTextItem(doc,"Body")            
                Dim k As Integer, thisList As Variant, found As Variant, diff As Long,elapsed As Double
                Dim st As NotesDateTime, ft As NotesDateTime
                found = False
                For j = Lbound(serverlist) To Ubound(serverlist)
                      richStyle.Bold = True
                      rtItem.appendstyle RichStyle
                      rtitem.appendtext serverlist(j)
                      rtitem.Addnewline 1,True      
                      richStyle.Bold = False
                      RTItem.appendstyle RichStyle
                      Set targetdb = New NotesDatabase(serverlist(j), targetdbstr)
                      If targetdb.isopen Then
                            Set targetview = targetdb.getview(targetviewstr)
                            If Not targetview Is Nothing Then
                                  Set vcoll = targetview.getalldocumentsbykey(thisuser.common)
                                  If vcoll.count >1 Then
                                        'Print "Found " + Cstr(vcoll.count) + " documents for " + serverlist(j)
                                        Set targetdoc = vcoll.getfirstdocument
                                        While Not targetdoc Is Nothing
                                              Set starttime =New NotesDateTime(Format(targetdoc.starttime(0), "mm/dd/yyyy" + " 12:01 AM"))
                                              diff = starttime.timedifference(thisStart)
                                              'Print "Processing document for " + starttime.dateonly + " (" + Cstr(diff) + ")"
                                              If starttime.dateonly = thisStart.dateonly Then
                                                    thisList = targetdoc.body                                          
                                                    found = True
                                                    If targetdoc.body(0) <> "" Then
                                                          doc.reads = doc.reads(0) + targetdoc.reads(0)
                                                          doc.writes = doc.writes(0) + targetdoc.Writes(0)
                                                          doc.Transactions = doc.Transactions(0) + targetdoc.transactions(0)
                                                          If targetdoc.hasitem("finishtime") Then
                                                                If targetdoc.finishtime(0) <>"" Then
                                                                      Set ft = New NotesDateTime(targetdoc.finishtime(0))
                                                                      Set st = New NotesDateTime(targetdoc.StartTime(0))
                                                                      elapsed = Round(ft.TimeDifference(st)/3600,2)                  
                                                                End If                                                      
                                                                elapsed = 0
                                                          End If
                                                          doc.ElapsedTime=doc.ElapsedTime(0) + elapsed                                                
                                                          For k = Lbound(thisList) To Ubound(thisList)
                                                                If Trim(thisList(k)) <>"" Then
                                                                      rtitem.appendtext Format(targetdoc.starttime(0),"hh:mm AM/PM")
                                                                      rtitem.appendtext Rtrim(thisList(k))
                                                                      rtitem.addnewline 1,True                                                            
                                                                End If
                                                          rtitem.appendtext Format(targetdoc.starttime(0),"hh:mm AM/PM")
                                                          rtitem.appendtext "No read/write log entries found for this entry"
                                                          rtitem.addnewline 1,True      
                                                    End If
                                              End If
                                              If diff = 0 Then
                                                    If found Then
                                                          rtitem.addnewline 1,True
                                                    End If                                          
                                              End If                                    
                                              found = False
                                              Set targetdoc = vcoll.getnextdocument(targetdoc)
                                  End If
                            End If
                      End If            
       True, False, True      
                Set doc = Nothing
          Call agentLog.LogAction("Log Summaries Complete")
          Call agentLog.Close
          Exit Sub
          Call agentLog.LogAction("Error running agent log: " + Error$ + "-" + Str(Err))
          Call agentLog.Close
          Exit Sub
    End Sub

    Image of form is here:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Suggested Solutions

    Title # Comments Views Activity
    Lotus Domino Server Failure 1 166
    Event in Notes Form after open and visible 10 208
    Send email lotus notes / VBA 6 159
    Domino Server 11 54
    For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
    I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now