Running an agent on the server (attention, NEWBIES question)

Hello,

I need to run this agent on all of my mail files (see the agent at the bottom). The newbies question is: where do I create the agent so it can run on the server?

The agent:

Sub Initialize

Dim s As New NotesSession

Dim tdb As NotesDatabase

Dim fileName As String

Dim txt As String

Dim strServer As String

Dim strMailfileName As String

Dim fileNumber As Integer

Dim servname As NotesName

Dim nagent As NotesAgent



Set servname = s.CreateName( s.CurrentDatabase.Server ) 

strServer = servname.Common 

’ Alter the following line to point to your text file

filename = "/Domino/Domfppq1/Data/infolist.txt"



fileNumber = Freefile

Open fileName For Input As fileNumber



Do While Not Eof(fileNumber)

	

	Line Input #fileNumber, txt

'Make sure we are not processing a new line, line feed,

’ a combination of the two, or a null string.

'If so restart above in case we are at the EOF

	If (txt = Chr(13) + Chr(10)) Or (txt = Chr(10)) Or (txt = Chr(13)) Or (txt = "") Then Goto restartloop

	strMailfileName = txt

	Set tdb = New NotesDatabase(strServer, strMailfileName)

	

	If tdb.IsOpen Then

'We have access to the DB so lets get a handle

’ to out of office agent

		Set nagent = tdb.GetAgent("OutOfOffice") 

		Call nagent.Remove()

		

	End If 

restartloop:

Loop

End Sub

thanks for your help

Subject: You can put it in any database

You just need to put it in a database on the server, doesn’t matter which one. For simplicity you can just make a new database.

Once you have it in a database, set it up so that it is enabled on a schedule, but set the schedule to “Never”. This will make it runnable by the server but the agent manager won’t run it automatically.

To run it, use this command:

tell amgr run “.nsf” ‘’

  • Bruce

Subject: thanks, that make sense!!