Grabbing Replication settings from a Mail database

I need to run through all our mailboxes to see if REPLICATION is turned OFF. (I figure it’s easier then checking for turned ON). I need to grab each mailbox in the MAIL folder and check each individual mailboxes REPLICATION setting. Right now I’m just putting up a prompt box but for those of you more ingenious than me you can give me hints to write to a Notepad file. My issue is even though I am just testing on my mailbox where REPLICATION is turned OFF on it there is nothing prompting me to tell me it is turned OFF.

Here is the code which is basically an example I found in the help with some other code added in.

%REM

Agent Replication On or Off

Created Aug 16, 2010 by 

Description: Comments for Agent

%END REM

Option Public

Option Declare

Const MAIL$ = “mail”

Const SLASH$ = ""

Sub Initialize()

Dim session As New NotesSession

Dim directory As NotesDbDirectory

Dim db As NotesDatabase

Dim rep As NotesReplication

Set directory = session.GetDbDirectory( “servername” ) 'Get Directory of Curent Server

Set db = directory.GetFirstDatabase(DATABASE) 'Get the first database

Do While Not (db Is Nothing) ' while there are still databases

If StrLeft(db.FilePath,SLASH) = MAIL Then

Call db.Open(“”,“”)

Set rep = db.ReplicationInfo

’ settig Rep

If rep.Disabled Then

'checking for replication turned on or off

MsgBox(db.FileName) 'present mailbox name

MsgBox(db.Type ) 'present type should be a mailbox

MsgBox (rep.Disabled)

'tell whether it is turned on or off

End If

End If

Set db = directory.GetNextDatabase

Loop

End Sub

Thanks in advance

Subject: Never mind it worked!!

To answer my own question the code worked. Sorry about that!

Tom

Subject: much easier way to get that info

look in catalog.nsf. each db, including mail files, will have an entry in there and you will see replication setting on the Replication tab. You can build a view in the catalog to display this field.

Subject: You are right

Paul, Thanks for the tip. I looked in the catalog. It does show were db’s Replication is turned “OFF” or “ON”. One possible draw back though is not all databases maybe cataloged. None the less great tip!

Subject: Incorrect! All databases are logged!

You just need to change the view selection formula to show them.

Create a new view in the Database Catalog. Set it to copy from, say, ‘Applications\by Title’, select save & Customize, then remove the following from the selection formula:

& !(DBListInCatalog = “0”). Save the view.

In the new view you should now see all databases, regardless of whether the database property ‘List in database catalog’ is checked or not.

hth

Tony