Tip

Email Database Acl To Yourself

For those with anything less than manager access to a database, and that
database Access Control List is too large (and thus won't scroll down for such
non-managers),
this code may be useful.

Just change the server and database file name in the first line of code to the
server & database you want to grab the ACL info from.
Dim db As New NotesDatabase( "NOTES-APPS-KC01P", "accserv\ascal.nsf" )
Dim acl As NotesACL,session As New notessession
Dim entry As NotesACLEntry,myLevel As String,t1 As Integer,myFile As String
Set acl = db.ACL
myFile = "C:\myACL.txt"
Open myFile For Output As #1
Set entry = acl.GetFirstEntry
Do Until entry Is Nothing
t1 = entry.level
If t1=6 Then myLevel = "Manager"
If t1=5 Then myLevel="Designer"
If t1=4 Then myLevel="Editor"
If t1=3 Then myLevel = "Author"
If t1=2 Then myLevel = "Reader"
If t1=1 Then myLevel = "Depositor"
If t1=0 Then myLevel = "No Access"
Print #1,entry.name;Tab(50);myLevel
Forall y In entry.roles
If y = "" Then
Else
Print #1," . . . role: " & y
End If
End Forall
Set entry = acl.GetNextEntry(entry)
Print #1," "
Print
#1,"----------------------------------------------------------------------------
-----------------------"
Print #1," "
Loop
Close #1
Print "File written to " & myFile

REM Compose the Email document and attach the file, save & send
Set doc = New NotesDocument( db )
Set rtitem = New NotesRichTextItem( doc, "Body" )
Dim recipients( 1 To 3 ) As String
recipients(1) = session.CommonUserName
MessageSubject = "ACL List"
MessageBody = "Here is the file attachment for an ACL you queried. Right
click the file and then click "+Chr$(34)+ "Launch" + Chr$(34) + " to view."
doc.Body = MessageBody
Set object = rtitem.EmbedObject (EMBED_ATTACHMENT,"",myFile,"Attachment1")
doc.Form = "Main Topic"
doc.Subject = MessageSubject
Call doc.Send( True, recipients )
Call doc.Save(True,True)
Print "message sent!"
Messagebox "Email Sent!",0,"Email Sent!"
REM Now Delete the temp file
Kill MyFile
Print "Temp file: " +MyFile + " has been deleted."

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.