Running code that creates a TimerJobDefinition outside of Central Admin

Jaap Vossers
  • Running code that creates a TimerJobDefinition outside of Central Admin Jaap Vossers

    I have run into a problem several times now where I have developed a custom timer job, and I want my site collection administrators to manage the schedule of this job with a custom application page but I keep running into security related obstacles.

    Since timerjobs are child objects of SPWebApplication, they are stored in the config database. If you have set up your farm properly in such a way that the App pool user for your content web application does not have write access to the Config database, you can't create new TimerJobDefinitions from code that runs in your content web app. A bad workaround/hack would be to raise the database permissions for your app pool user on the config database. A better approach would be to move the schedule admin page into Central Admin, because the Central Admin app pool account can write to the config database But then we lose the whole point - I want my site collection administrators to be able to manage the schedule!

    The only alternative solution I can think of is to have another timerjob that polls some kind of queue (for example a sharepoint list in my site collection) for new timerjobs to create, and creates it if an item has been added to that queue from within the content web app using the custom schedule admin page.

    My question is, is there another way that is both efficient and elegant?

  • this is basically the same question as the Automating Site Collection question. You're on one solution, using a queue. Another approach could be having a web service in CA that you can call from your web apps.

    /WW

Tags
database permissions application-pages timer-jobs development
Related questions and answers
  • My goal is to programmatically activate a Web Application scoped feature. I'm running this code from a feature receiver of a Web scoped feature. I'm logged in as a Farm Administrator. My app pool...; { SPSite elevatedSite = new SPSite(web.Site.ID); elevatedSite.WebApplication.Features.Add( /*guid*/ ); //throws SecurityException }); } I don't understand why I would be getting this error if both the app pool acct and the current user are Farm Administrators. Please help.

  • I have a need to allow non farm administrators to be able to create site collections using a very specific site definition. These people will not have access to central admin and so require a custom solution to allow the creation of these. I have tried several solutions, but want some consensus on a recommended approach. Custom Web Service - I have written a custom web service to perform this task however this caused major headaches and even though the web service was running in an app pool using the same identity as the sharepoint app pool I could not get this to work. Also had form digest

  • When I go to manage service applications in Central Administration and try to create a new service application like: New > Create a new service application, the link isn't active. My issue is I would like to create a Search Service Application after installing Search Server Express 2010. Do I need to run the Farm Configuration Wizard and install the below if I can create a Search Service... the possibility to create a new search service apps? The only new link i can see on the service application page menu is to create BDC service. alt text http://www.freeimagehosting.net

  • isn't in the IIS metabase because it's being handled by DNS. My web application has an AAM set up and a host header on the web site in IIS. I also tried running the code without using the FQDN of the site, e.g. http: //servername:4860. Permissions: The identity of the the Silverlight application pool has db_owner permissions to my content database, and is also a site collection administrator. I can't have both web sites use the same application pool because the Silverlight application needs to run in a .NET app pool. x86 vs x64: My Silverlight application has to be compiled for x86 - I'm

  • on the site collection for the forms authentication logon page to work from Office SharePoint Server. Contact your administrator to have anonymous access enabled in Central Administration and IIS. Manage...I am using SharePoint 2007 Server x64 on Windows Server 2008 x64. I create a new SharePoint web application with a new site collection at the root of the web application. I select the template "publishing portal" for the site collection. I have also enabled anonymous access. Now the basic function is fine, except that I do not know how to change the first front page (i.e. the page showed to end

  • this question so we can create a central repository for renaming the various databases. I will try to find as many answers as possible myself, but would appreciate answers from the community as well..._[some guid] User Profile Service Application_SocialDB_[some guid] User Profile Service Application_SyncDB_[some guid] WordAutomationServices_[some guid] WSS_UsageApplication Update: If you have multiple SharePoint 2010 farms connected to a single database server then you can see which databases belong to a farm on the following Central Administration screen: http://[Your CA Server]/_admin

  • I am in a position where service credentials change quite a lot, I would normally use central admin to change the credentials but quite often the application pool that runs that is using the same credentials which I want to change. I've tried writing the following powershell script but I always get FALSE as the result of SetPassword. Any ideas what i am doing wrong? $login and $password... $managedaccount -ConfirmPassword $securestring -NewPassword $secureString $Apps = Get-SPWebApplication foreach ($App in $Apps) { $AppPool = $App.ApplicationPool #$AppPool #Write-Host

  • into this and decided to completely re-install MOSS on that box. I have tried to re-run the config wizard to hook this server up to the existing config database and to re-create the central admin site. However I now get a security exception when the config wizard is run. These are the relevant lines from the config wizards log file: 05/05/2010 09:43:45 8 INF Creating connection string for admin content db... as the central admin db access account has access to the config database (I have admin access so can check this) but I cannot ascertain if it has access to the existing admin content database

  • these are SSPI errors but sometimes the error message just says "unable to connect to config database". In SharePoint configuration I went to "Application Management -> Check Services Enabled in this Farm" and it shows me two warnings. I am wandering if the second warning has anything to do with these intermittent database errors. And, I want to know how can I solve these warnings. Warning 1...: Thanks for your reply. I understand about the first warning and I just left it as it is. However, same set of services are running on each WFE not sure what is different let me show you what

Data information