Manage Learn to apply best practices and optimize your operations.

Count the group members

Here's how to count the number of users in a group.

Ever wonder how to find out how many users are there in a group and when to create a new group? This is very useful to stop over loading a single group and stick to uniform group size. This was created as an action button in groups for Admins.

Sub Initialize
	' This agent is to count the members in a given group .. 
	Dim session As New NotesSession
	Dim db As NotesDatabase
	Dim collection As NotesDocumentCollection
	Dim doc As NotesDocument
	Dim item As NotesItem
	Dim msg As String
	Dim grp As Variant
	Set db = session.CurrentDatabase
	Set collection = db.UnprocessedDocuments
	Set doc = Collection.GetFirstDocument
	grp =doc.GetItemValue("ListName")    
	Set Item = doc.GetFirstItem("Members")
	Forall x In Item.Values
		count = count+1
	End Forall
	If count =>250 Then
		msg = " This group - "&grp(0)+"  - has  "&count+" members."& Chr(10) &Chr(10)& " Create a new group for further entries."		
		Messagebox msg, MB_OK+16, "Group Member Count"
		msg = "This group - "&grp(0)+" - has "&count+" members."
		Messagebox msg, MB_OK+48, "Group Member Count"
			End If
End Sub

Dig Deeper on Lotus Notes Domino Administration Tools

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...