Personal Blog of Thomas Hampel - Creative Mythbusting in Development and Collaboration

Who am I?

Feeds

Archives

April 2025 (1)
January 2025 (1)
December 2024 (1)
November 2024 (2)
October 2024 (2)
September 2024 (1)
July 2024 (1)
May 2024 (2)
April 2024 (3)
March 2024 (1)
February 2024 (2)
January 2024 (5)
December 2023 (3)
November 2023 (2)
October 2023 (1)
September 2023 (4)
June 2023 (1)
April 2023 (3)
March 2023 (1)
February 2023 (1)
July 2022 (1)
September 2021 (1)
August 2021 (2)
May 2021 (1)
February 2021 (3)
January 2021 (1)
November 2020 (1)
October 2020 (2)
September 2020 (2)
March 2020 (1)
November 2019 (1)
August 2019 (1)
July 2019 (1)
March 2019 (1)
December 2018 (1)
November 2018 (1)
October 2018 (1)
September 2018 (1)
May 2018 (1)
January 2018 (1)
December 2017 (1)
November 2017 (1)
September 2017 (1)
March 2017 (2)
February 2017 (5)
November 2016 (1)
September 2016 (4)
April 2016 (1)
March 2016 (7)
January 2016 (1)
December 2015 (1)
November 2015 (3)
August 2015 (1)
July 2015 (2)
June 2015 (5)
May 2015 (5)
March 2015 (3)
February 2015 (2)
January 2015 (4)
December 2014 (3)
November 2014 (1)
September 2014 (4)
August 2014 (1)
May 2014 (4)
April 2014 (1)
March 2014 (2)
February 2014 (3)
January 2014 (2)
October 2013 (1)
September 2013 (1)
August 2013 (2)
July 2013 (2)
March 2013 (2)
February 2013 (4)
January 2013 (3)
December 2012 (2)
November 2012 (1)
October 2012 (2)
September 2012 (4)
August 2012 (3)
July 2012 (1)
June 2012 (6)
May 2012 (1)
February 2012 (2)
January 2012 (1)
December 2011 (4)
November 2011 (2)
September 2011 (1)
May 2011 (2)
March 2011 (1)
January 2011 (1)
November 2010 (5)
October 2010 (2)
September 2010 (2)
August 2010 (1)
July 2010 (3)
June 2010 (1)

QuickR - How to count the number of registered users?

Thomas Hampel
 14 June 2012

Lets assume an IBM QuickR environment where all users are allowed to access the Domino server that QuickR runs on.
How would an administrator report the number of users?

Using the log.nsf is not the right place, because users leave a trace there just by accessing (e.g.) the Domino directory, but not QuickR.
A better way is to use the QuickR Place Catalog (placecatalog.nsf) on your Quickr server. It's design is set to not show up in the Open Database dialog, so you either need to type in the filename or use the Admin client to open it up.

Image:QuickR - How to count the number of registered users?
It contains a view named "Total Places By Member" which will show the total number of quickr users across all places including those with Anonymous access, all categorized by user name.

Image:QuickR - How to count the number of registered users?
So to identify the number of QuickR users, collapse everything
Image:QuickR - How to count the number of registered users? in this view so that you can see the first category only.
What you can see is  member number and the user name  
Image:QuickR - How to count the number of registered users?
Now scroll down to the last entry in this view - the last number displayed there is the total number of unique users.


Be aware:
  • If there are places which grant access to a group, then groups displayed in this view need to be resolve recursively
  • If Anonymous access is enabled , special licensing rules apply

If anyone would like to do this automatically, here is some LotusScript code which might help.



%REM

        Agent Count number of registered QuickR Users
        Created Jun 14, 2012 by Thomas Hampel
        Description:
        A simple agent to report QuickR user names - feel free to modify
%END REM
Option Public
Option Declare
Const QuickRServer$ = "Domino-Name-Of-QuickR-Server"
Const QuickRPlaceCatalog$ = "PlaceCatalog.nsf"
Const QuickRViewName$ = "TotalPlacesByMember"
Const NABServer$ = "Domino-Name-Of-QuickR-Server"
Const NABFilename$ = "names.nsf"
Dim userlist List As boolean
Sub Initialize
        Dim nab As New NotesDatabase (NABServer$, NABFilename$)
        Dim PlaceCatalog As New NotesDatabase (QuickRServer$, QuickRPlaceCatalog$)
        Dim view As NotesView
       
        If Not NAB.IsOpen Then
                Print "Unable to open Domino Directory : " & NABServer$ & " - " & NABFilename$
                end
        End If
       
        If Not PlaceCatalog.Isopen then
                Print "Unable to open QuickR PlaceCatalog : " & QuickRServer$ & " - " & QuickRPlaceCatalog$
                End
        End If
       
        '# load all elements into list object
        Set view = PlaceCatalog.getView (QuickRViewName$)
        Call LoadNamesFromView (view)
               
        '# resolve membership
        Call ResolveGroupMembers
       
        '# output result
        Print "Total number of unique users is " & CountUsers()
       
        '# Anonymous access...
        If IsElement (userlist ("anonymous")) Then
                Print "Anonymous access to one or more places is ENABLED"
        Else
                Print "Anonymous access to one or more places is DISABLED"
        End If
End Sub

Function LoadNamesFromView (View As NotesView)
        Dim doc As NotesDocument
        Dim tDoc As NotesDocument
        Dim usernameArray As variant
        Dim usercount#
        '# exit if the view is not valid
        If view Is Nothing Then Exit Function
        view.AutoUpdate = False

        Set doc = view.getFirstdocument
        While (Not doc Is Nothing)
                Set tdoc = view.getNextDocument (doc)
                If doc.isValid Then
                        usernameArray = Evaluate (|@Unique(@Trim(PlaceOwners : PlaceManagers : PlaceEditors : PlaceAuthors : PlaceReaders))|, doc)
                        ForAll u In usernameArray
                                '# add name to list of unique users
                                userlist (u)= True
                                usercount# = usercount + 1
                        End ForAll
                End If
                Set doc = tdoc
        Wend
        Print "Found " & usercount# & " entries across all places."        
End Function

Function expandGroupNames(GroupName As String, GroupMemberArray As Variant) As Boolean
        on Error GoTo errorHandler
        expandGroupNames = False
        If Len(Trim$(GroupName)) = 0 Then
                GoTo functionExit '# if no name is passed, don't even try to resolve the group name
        End If
 
        '# Undocumented @Formula from http://www-304.ibm.com/support/docview.wss?uid=swg21101582
        '# Input from http://www.dominoguru.com/pages/01202009030630.html
       
        GroupMemberArray = Evaluate(|@ExpandNameList("| & NABServer$ & |":"| & NABFilename$ & |";"| & GroupName$ & |")|)
        GroupMemberArray = ArrayUnique(GroupMemberArray, 5)
        If UBound(GroupMemberArray) = 0 Then
                '# if there's only one group member, check to see if it's valid
                if StrCompare(GroupMemberArray(0), GroupName$, 5) = 0 Then
                        '# if the only member found is the group name itself, the group couldn't be resolved
                        GoTo functionExit
                 End If
          End If
        expandGroupNames = True
       
functionExit:
Exit Function

errorHandler:
        MsgBox "Error " & Err & ": " & Error & " at line " & Erl & " of " & GetThreadInfo(1) & ".", , "Error encountered!"
        Print "Error " & Err & ": " & Error & " at line " & Erl & " of " & GetThreadInfo(1)
        Resume functionExit
End Function

Function ResolveGroupMembers As Integer
        Dim GroupMemberArray As Variant
        '# loop all users found
        ForAll user In userlist
                '# try to resolve the existing list entry
                If expandGroupNames (ListTag(user), GroupMemberArray) Then
                        ForAll members In GroupMemberArray
                                '# add the new name to the list
                                userlist (members) = true
                        End ForAll
                End If
        End ForAll
End Function


Function CountUsers As Long
        Dim count&
        ForAll user In userlist
                count& = count + 1
        End ForAll
        Countusers = count&
End Function
Comments [0]
Tagged with: QuickR
Go ElsewhereSubscribe to RSSAboutStay ConnectedAnd More
Thomas Hampel, All rights reserved.