Sean Cull

Planet Lotus

This is where planet Lotus would appear if ie could be made to play nicely


Long live the King, long live Firefox



p.s. it probably can work fine but Ihave lost the will to find out just at the moment

SNTT - Short agent to change the run on server for scheduled agents 

Sean Cull  4 December 2008 18:00:00

I use this administration agent in my databases to quickly change the "run on" server for all f the scheduled agents when I deploy a template to a new server.

The other approach I use is to have the agent "run on all servers" but to then have each agent check for a configuration document in the database which then lists which servers it is allowed to run on. If the current server is not in the configuration document then the agent exits.

Sub Initialize
        Dim session As New NotesSession
        Dim ws As New notesuiworkspace
        Dim db As NotesDatabase
        Set db = session.CurrentDatabase
        Dim askme As Variant
       
        askme = ws.Prompt (PROMPT_OKCANCELEDIT, _
        "Suggested Server", _
        " You must use the format CN=...." ,db.server)
        If Not Isempty (askme) Then
                Forall a In db.Agents
                        If Not a.servername = "" And Not a.servername = "*" Then
                                If a.servername = askme Then
                                        Print a.name + " already set to run on chosen server"
                                Else
                                        Print "changing " + a.name + " from " + a.servername + " to " + askme
                                        a.servername = askme
                                        Call a.save
                                End If
                        End If
                End Forall                
        End If
        End Sub


change_server.lss



 Dev Tips  Show-n-Tell Thursday 


No Comments Found

Please leave a comment


Subject:
   
Name:
E-mail:
 
Comment:  (No HTML - Links will be converted if prefixed http://)
 
Remember Me?