Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to know if it is possible to have configurable properties for a timer job that can be managed via Central Administration, prior to the job actually running.

Let me paint a usage scenario:

What I would like to do is:

  1. Install a custom timer job that needs to insert list items into a certain site (the url can change with each installation. This might be dev,test,production.
  2. Before running the job - be able to somewhere change the URL string, that will point to the site where the timer job will insert list items to.
  3. Run the job as normally, in the job it checks the configuration and pulls the URL to the site.

This would make the whole process much more easier than what I am doing now, having to hard code this URL in the DLL, and recompile and distribute a fresh specific wsp package per system.

Thanks in advance.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

There are a couple of approaches.

  1. Use property bags or Hierarchical object store to store your configuration. Use Powershell scripts to modify the configuration

  2. Create a central configuration list. (Can be located anywhere in the site) Provide the URL of this list in an app setting value in your owstimer.exe.config. Save all your configuration values as text or serialised strings in this list. Read the URl of the list from the app setting, access the list using object model, and retrieve the configuration values from the list. This way, you can modify your configurations from the browser without logging into your server.

share|improve this answer
    
The list approach is sensible, located in Central Admin.... –  user879 Feb 16 '11 at 14:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.