Automatically enabling local scheduled agent handling

I have developed an application which is to be deployed on many users’ local Notes clients. This application polls the local log.nsf for replication events, processes certain of these events, and then replicates these in turn to the mother ship (replica). This processing is executed by a pair of scheduled agents which must run locally on each Notes client.

To enable this, I need to enable local scheduled agents on each user’s workstation. Obviously, this would be an enormous undertaking if attempted manually, and the users cannot be counted upon for anything - even something so simple as opening an email and clicking a button. We do have the availability of Microsoft SMS for the deployment of the database and notes.ini settings changes; however, this is problematic as there does not seem to be a way of identifying in the Notes.ini which specific argument to change.

I’m pretty certain that the enabled status of Local Scheduled Agents is stored within the Preferences argument; however, a cursory examination of this setting reveals that there is a lot more “under the hood” than meets the eye. For example, before I changed the setting to permit the execution of local scheduled agents, the line read: “Preferences=-2147480463”. After changing the user preferences to permit the execution of these agents, the line read: “Preferences=-2013262735”.

At this point it’s obvious even to a dullard like me that this value is not the mere concatenation of several different preference settings. My belief is that there must be some sort of algorithm in play for condensing them into a relatively short value - but I have absolutely no idea what that algorithm might be or how it could be inferred. Has anyone here looked at this before? Any insights? Crazy guesses even? Any and all responses would be very much welcomed. Thanks.

Subject: Automatically enabling local scheduled agent handling

Use a Desktop Policy to enforce the setting to be enabled by default. You can find this setting on the Desktop Policy doc on the Preferences > Basic tab at the bottom.

Subject: RE: Automatically enabling local scheduled agent handling

Paul, thank you for your reply. Yes, I’m aware of this setting - but I need to be able to “force” it upon users without their involvement - that’s the problem I’m having. I can’t rely on their doing this on their own successfully and am hoping I can do so by using SMS to push down a notes.ini adjustment - if only I knew how to reverse engineer the settings change there. That’s my predicament.

Subject: RE: Automatically enabling local scheduled agent handling

No user involvement should be needed. The Policy will force the change on the client automatically when the user authenticates with their home mail server. A replication event should do it but I have not tested it.

Subject: RE: Automatically enabling local scheduled agent handling

Paul,

We don’t use Notes mail. I cannot say for certain that all or even most of our users even have a home server setting in their local address books.

Subject: RE: Automatically enabling local scheduled agent handling

That setting is stored as a part of the PREFERENCES= line in notes.ini. That value is stored in decimal, but when expanded to binary is 64 1’s or 0’s to hold various preferences. I’m running Notes 7.0.2; when I enable local schedule agents the 37th bit becomes a 1, and when i disable it becomes zero. To flip just tis one bit you could use this to turn it on:Sub Initialize

Const LOCAL_AGENTS = &H8000000

Dim s As New NotesSession

Call s.SetEnvironmentVar( "Preferences", Cstr( Clng( s.GetEnvironmentValue( "Preferences", True )) Or LOCAL_AGENTS ), True ) 

End Sub

and this to turn it off:

Sub Initialize

Const LOCAL_AGENTS = &H8000000

Dim s As New NotesSession

Call s.SetEnvironmentVar( "Preferences", Cstr( Clng( s.GetEnvironmentValue( "Preferences", True )) And Not LOCAL_AGENTS ), True ) 

End Sub

Sometimes we mail this kind of code in a button, or hide it in the Postopen event in their mail database. You don’t use mail but maybe you can try it in the Postopen on some other database that’s widely used.

Simce you’re altering Notes.ini you’ll want to make a backup and do some testing before going live, to verify you get the results you want, and no bad side-effects.

Subject: RE: Automatically enabling local scheduled agent handling

Thi is a top article, works very well. Desktop policy doesn’t always work, some people turned on, some are not. Also desktop policy does not have log confirming…

Subject: RE: Automatically enabling local scheduled agent handling

It doesn’t matter if you use Lotus Notes for mail or not. Take a look at Policy docs in admin help.