ACL script over all mail db's works on first one only

I need a script to add users to the ACL in all of our mail db’s. The script I have seems to work fine, but when I add the code to loop through all db’s, it works on only the first one it finds. I get no errors and it appears to open all db’s, but the ACL changes are made to only the first one. Any help would be greatly appreciated.

Thanks!

Sub Initialize

Dim oldDbdir As New NotesDbDirectory("MAILSERVER")

Dim db As NotesDatabase

Dim mailACL As NotesACL

Dim ACLEntry As NotesACLEntry

Dim newACLEntry As NotesACLEntry



Set db = oldDbdir.GetFirstDatabase(DATABASE)



While Not (db Is Nothing)

		Call db.Open( "", "")

		Set mailACL=db.ACL

		Set newACLEntry=mailACL.CreateACLEntry  ("NEWAdmin/MAILDOMAIN", 6 )

		newACLEntry.UserType=ACLTYPE_SERVER

		Call mailACL.Save

		mailACL.Save

		ignoreCounter=0

	Set db=oldDbdir.GetNextDatabase

Wend

End Sub

Subject: One quick point - you call the MailACL.Save twice - is that necessary?

Subject: ACL script over all mail db’s works on first one only

I’m not sure why that would not work. The first thing I would look at is do you have Manager Access to all the Mail DBs? Can you sign the agent with a server ID then run it as a scheduled agent?

A small commercial - we have Workflo!ACL Manager that does what you want plus a bunch more. Get a demo at

http://wfs.com/workweb/wfsweblib.nsf/Src/DocSet*Notes+Net07

Subject: RE: ACL script over all mail db’s works on first one only

I have manager access. Additionally, I moved the script to the server and ran it from the client with ‘Full Admin rights’ - or whatever that is called. Still no joy.

Subject: RE: ACL script over all mail db’s works on first one only

If you run your agent manually with the debugger on, then step through the code. Does the OldDBDirectory contain the list of Notes DBs that you would expect?

Subject: RE: ACL script over all mail db’s works on first one only

I re-wrote the script in Java and it worked… Go figure. I assume java and LS call the same processes - so why it works is confusing to me. Thanks for the efforts.