Export acl

How can I export acl to text file?

Subject: Re: EXPORT ACL

its - been a while - i am sure by thsi long time you have found a answer :wink: but i also was looking for help with this matter. and have looked in the forum several times with no solution - so i wannt to give back something - our company has now aquired Ytria scanEZ it gives a flat view of the acl and also lets me export it Lotus Notes ACL and Roles: Manage Domino Database Security

Subject: EXPORT ACL

Hi Danielle,

you can use NotesPeek tool to export ( or dump )

acl to a file.

Also you can use NotesDXLExporter LotusScript class to export ACL to an XML, and eventually apply an XSL.

Giorgio

Subject: RE: EXPORT ACL

I wrote this code awhile ago and use it within a shared action to achieve what you have described. It will write your acl out to a text file, including the acl roles. Just make sure that you are listed in the ECL to write to the file system:

Sub Click(Source As Button)

'acl export by A. Young on 11.2.2001

Dim ns As New NotesSession

Dim nwsWs As New NotesUIWorkspace 

Dim ndb As NotesDatabase

Dim nacl As NotesACL

Dim nacle As NotesACLEntry

Dim intloop As Integer, inx As Integer, proc As Integer, total As Integer, fileNum As Integer 

Dim dbUserType As Integer, dbUserLevel As Integer

Dim strRoleslist() As String, strUserType As String, strUserLevel As String

Dim this As String, this1 As String

Dim pathName As String, fileName As String

Dim whenNow As String



Set ndb = ns.CurrentDatabase

Set nacl = ndb.ACL

Set nacle = nacl.GetFirstEntry	

whenNow$ = Today()

inx = 0

proc = 0

total = 0



Do While Not (nacle Is Nothing)		

	this = Strright(nacle.Name, "CN=")

	this1 = Strleft(this,"/O=")			

	dbUserType = nacle.UserType

	dbUserLevel = nacle.Level

	If dbUserLevel = 1 Then

		strUserLevel = "Depositor"

	End If

	If dbUserLevel = 2 Then

		strUserLevel = "Reader"

	End If

	If dbUserLevel = 3 Then

		strUserLevel = "Author"

	End If

	If dbUserLevel = 4 Then

		strUserLevel = "Editor"

	End If

	If dbUserLevel = 5 Then

		strUserLevel = "Designer"

	End If

	If dbUserLevel = 6 Then

		strUserLevel = "Manager"

	End If

	If dbUserType = 0 Then

		strUserType = "Unspecified"

	End If

	If dbUserType = 1 Then

		strUserType = "Person"

	End If

	If dbUserType = 2 Then

		strUserType = "Server"

	End If

	If dbUserType = 3 Then

		strUserType = "Mixed Group"

	End If

	If dbUserType = 4 Then

		strUserType = "Person Group"

	End If

	If dbUserType = 5 Then

		strUserType = "Server Group"

	End If

	If this1 <> "" Then

		For intloop = 0 To Ubound(nacle.Roles)

			If proc = 0 Then

				Redim Preserve strRolesList(total + 1)

				strRoleslist(total) = "Username: " & this1  

				total = total + 1					

				Redim Preserve strRolesList(total + 1)

				strRoleslist(total) = "User Type: " & strUserType

				total = total + 1					

				Redim Preserve strRolesList(total + 1)

				strRoleslist(total) = "Access Level: " &  strUserLevel

				total = total + 1					

				Redim Preserve strRolesList(total + 1)

				strRoleslist(total) = "Role(s): "

				total = total + 1					

			End If				

			If nacle.Roles(intloop)  <> "" Then

				Redim Preserve strRolesList(total + 1)

				strRoleslist(total) = nacle.Roles(intloop)

			Else

				Redim Preserve strRolesList(total + 1)

				strRoleslist(total) = "None" 

			End If				

			proc = proc + 1

		Next

	End If

	total = total + 1

	Redim Preserve strRolesList(total + 1)

	strRolesList(total) = "  "

	Set nacle = nacl.GetNextEntry(nacle)			

	proc = 0

	total = total + 1

Loop	



'prepare the output file

'name it after this database

fileName$ = "ACL Report for " & ndb.Title & ".txt"

direc = "c:\aclreports"

directory$ = Dir( "c:\aclreports", 16 ) 

'if the directory does not yet exist, make it  	

If directory$ = "" Then Mkdir(direc)

pathName$ = "c:\aclreports\" & fileName$	

fileNum% = Freefile()

Open pathName$ For Output As fileNum%

Print #fileNum%, "ACL Report" & Chr(9)

While inx < total

	Print #fileNum%, strRoleslist(inx)

	inx = inx + 1			

Wend	

Close fileNum% 	



message = "ACL export for " & ndb.Title & " was created successfully." & Chr(10) & Chr (10)

message = message & "The following file was created: " & Chr(10) & pathName  

Msgbox message, 0 + 64, "Export Successful"

End Sub

Subject: Maybe you could just export or print the corresponding document in catalog.nsf.

Subject: RE: EXPORT ACL

Fantastic!!! thank you, you just saved me a few hours of work!