Tip

Verify Group Members In Nab

Have you ever looked at the list of names in a group in your addressbook and
thought, "he retired last year"? This script verifies the membership in groups
in the name and addressbook. It generates a simple report showing exceptions.
Put this script in an agent and schedule it or run it manually on command. If
it is scheduled, the report will be saved on the server.

Current limitations:
- Server names and wildcards are reported as exceptions.
- Agent must reside in the NAB.
Sub Initialize

Dim Session As New NotesSession
Dim DB As NotesDatabase
Dim Group As NotesDocument
Dim Person As NotesDocument
Dim ReadPG As NotesDocument
Dim GView As NotesView
Dim PGView As NotesView

Dim fileNum As Integer
FileNum% = Freefile()
Close
Print "Logging output messages to \APPS\NOTES\GROUP.LOG"
Open "group.log" For Output As fileNum%
Print #FileNum%, "Audit Group Agent ", Now ' print a header line to log file
Print "Audit Group Agent ", Now ' print to log db (or to status line if run
manually)

Set DB = Session.CurrentDatabase
Set GView = DB.GetView ( "($VIMGroups)" )
Set PGView = DB.GetView ( "($VIMPeopleandGroups)" )

Set Group = GView.GetFirstDocument

Do Until Group Is Nothing
Print #FileNum%, Chr(10) & "Group: " & Group.ListName(0) & " " &
Group.ListDescription(0) & " - - - - - -"

Forall i In Group.Members
Set PersonName = New NotesName( i )
Set ReadPG = PGView.GetDocumentByKey( PersonName.Abbreviated )
If ReadPG Is Nothing Then
Print #FileNum%, " Entry does NOT exist - - " & PersonName.Abbreviated
Else
Print #FileNum%, " " & PersonName.Abbreviated
End If
End Forall ' all members

Set Group = GView.GetNextDocument ( Group )
Loop ' all groups

Close

End Sub

This was first published in November 2000

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.