
ADDRESS BOOK
Verify Nab Group Members To Gab
Tony Price 06.14.2000
Rating: --- (out of 5)




Hard time keeping your NAB Group members in sync with actual users? This script runs through each NAB Group member and verifies it to the Global Address Book. It adds the "not found" members to a field called "BadNames", which you must create on the Group form in the NAB (editable, text). It then sends a memo to whoever is listed at the end of the script, identifying the Groups containing BadNames and adds a doclink for each. Change GAB Replica ID, Search (if required) and addresses for the e-mail.
Code
Sub Initialize Dim Session As New NotesSession Dim db As notesdatabase Dim doc As notesdocument Dim Summary As Notesdocument Dim Collection As NotesDocumentCollection Dim CutOff As NotesDateTime Dim BadNames As String Dim n As Integer Set cuffoff = New NotesDateTime("1901/01/01") nablookup: Dim dbNAB As New NotesDatabase ( "","") Dim dbNABGroup As NotesDatabase Set dbNABGroup = session.CurrentDatabase ' **** Set the name of the GAB database **** ' **** Replace XXXX with rep ID **** Call dbNab.OpenByReplicaID( "", "XXXX") Dim viewNAB As NotesView Dim viewNabGroup As Notesview Set viewNAB = dbNAB.GetView("($VIMPeople)") Set viewNABGroup = dbNABGroup.GetView("($VIMGroups)") okay: Set db = Session.currentdatabase ' **** Select the collection of Group documents **** Search$="FORM="+"""" +"Group"+"""" Print "Collecting The Groups" Set Collection=db.search(Search$,CutOff,0) Set doc = Collection.getfirstdocument While Not (doc Is Nothing) n=0 doc.BadNames = "" Call doc.Save(False, True) ' **** Pull Member name, one at a time, and verify to the GAB
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

**** Forall members In doc.members Dim NameText As New NotesName(doc.Members(n)) ' **** Look for Non Groups *** Dim subString As String subString$ = Right$(NameText.Abbreviated, 13) ' **** change XXXX as per your mail If subString$ = "XXXX" Then Set docNAB = viewNAB.GetDocumentByKey(NameText.Abbreviated) ' **** If no entry in GAB Name view, add name to BadNames in the Group doc **** If docNAB Is Nothing Then Print doc.Members(n) & " not located in GAB" Dim item As NotesItem Set item= doc.GetFirstItem("BadNames") Call item.AppendToTextList(doc.Members(n)) Call doc.Save(False, True) End If End If ' **** change XXXX as per your mail If subString$ <> "XXXX" Then Set docNAB = viewNABGroup.GetDocumentByKey(NameText.Common) ' **** If no entry in NAB Group view, add name to BadNames in the Group doc **** If docNAB Is Nothing Then Print doc.Members(n) & " not located in NAB" Set item= doc.GetFirstItem("BadNames") Call item.AppendToTextList(doc.Members(n)) Call doc.Save(False, True) End If End If n=n+1 End Forall ' **** Go to next document in collection **** Set doc=Collection.GetNextDocument(doc) Wend newsletter: Dim dc As NotesDocumentCollection Dim news As NotesNewsletter ' **** Select the collection of all Group docs with Bad Names **** Search$="FORM="+""""+"Group"+""""+" & BadNames<>"+""""+"""" Print "Collecting The BAD Groups" Set dc=db.search(Search$,CutOff,0) ' **** Create the newsletter on the Summary form with doclinks **** Set news = New NotesNewsletter(dc) news.SubjectItemName = "ListName" news.DoSubject = True Set doc = news.FormatMsgWithDoclinks( db ) doc.Form = "Summary" ' **** Change Addressee(s) below as required, either individuals or a group**** Call doc.Send(True, "ADMINISTRATORS") Call doc.Send(True, "Tony Price/GroupSvc/USERS/TDGROUP") End Sub
 |

|
|
 |
|
 |