How do I create a report that determine's archiving . . . .

Hello, The impossible dream of the day is archive related. My manager and our legal department have decieded they want to know who/how many are archiving what method they are using and how frequently. What I want to do is create an agent in a database that goes out and checks each mail database. I think the logic should be as bellow

Open database \mail*.nsf

select (It’s that or nested if’s thanks but no)

case 1 archiving = not enabled

add 1 to total count for no archiving

print database name in second form for no

 archiving

case 2 archiving = enabled and done in the last

 30 days but not automaticly

add 1 to total count for manual archiving

print database name in second form for manual

 archiving

case 3 archiving = enabled and automaticly

add 1 to total count for auto archiving

print database name in second form for auto

 archiving

total number of days a week archiving add total

 number to days archiving field

add number of days before archiving to archiving

 time field

end select

total days archiving and archiving time divide

 both numbers by auto archiving total to

 create averages

A nice feature to add would be to total total counts and then create the precentages off the total number for each

Pipe dream does any one have this already done or can you point me in the right direction? I am an administrator not programmer. Thanks in advance

Laura

Subject: How do I create a report that determine’s archiving . . . . .

I can get you started, at least. Here’s part of a script that grabs each mailfile. From there, you’ll have to open the profile document and get the contents of the field to check against.

Sub Initialize

Dim session As New NotesSession

Dim ws As notesuiworkspace	

Set ws = New NotesUIWorkspace

Dim db1 As NotesDatabase 'poll thru databases

Dim dbname As String 'get filename

Dim db As NotesDatabase 'file to open

Dim caught As Variant

Dim userview As NotesView

Dim collection As NotesViewEntryCollection

Dim entry As NotesViewEntry

Dim userdoc As NotesDocument

Dim newnotesdoc As NotesDocument

'where to put the caught spam

Dim trapdb As notesdatabase

Set trapdb=session.GetDatabase("AI2","mail\SpamTrap.nsf")

'files to gather spam from

Dim myserver(0 To 3)As String

myserver(0)="server1"

myserver(1) = "server2"

myserver(2)="server3"

	caught=0

Dim mys As Integer	

mys = 0

While mys < 4

	Dim dbdir As New notesdbdirectory(myserver(mys))		

	Set db1 = dbdir.getfirstdatabase(DATABASE)

	While Not(db1 Is Nothing)

'only if it is in mail directory

		If Instr(db1.FilePath, "mail\") <>0 Then

			dbname = db1.Filepath			

			Print ("checking db " + dbname) 'prints to your log so you can see what was done - remove after testing, if desired

			Set db=session.GetDatabase(myserver(mys),dbname)

'during this part, you would get your profiledoc and the field value

		End If 'IF IT IS A MAILFILE			

		Set db1 = dbdir.GetNextDatabase

	Wend 'db1 Is Nothing

Wend 'mys < 7

’ you could potentially put this script under a button

’ then in the script, add database names to one or more lists

’ which you’d later write to the document, as shown below

’ uidoc.FieldAppendText(“Body”),Cstr(caught)

’ Call uidoc.refresh

End Sub