none
Custom Timer Jobs not visible in Central Admin Job Definitions

    Question

  • I have multiple custom timer jobs which I was using on old farm, and it was successfully working and was visible in the Central Admin Job Definitions.

    But ever since I moved to new farm, by restoring the site collections from old to new farm, and deployed the custom timer jobs on new farm, they are not visible in Central Admin Job Definitions.

    I tried to change the scope of the solution to "Web Application", and deployed it's wsp in new farm, then also they are not visible in Job Definitions. But I can see them in "Farm Solutions", they have been successfully deployed.

    Please suggest what should I do.

    Monday, September 16, 2013 4:30 AM

Answers

  • Hi Shailesh, 

    Are you activating the feature using PowerShell, or using the UI?

    Can please try this:

    1. Logon to the SharePoint server with a Farm Admin account (an account that has access to write to the Farm config database)
    2. Activate the feature using PowerShell 


    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here: Upload and Crop User Profile Photos

    Thursday, September 26, 2013 9:12 AM

All replies

  • Are you activating feature with custom code?  If not then activate timer job feature in your Farm.

    Hope this helps.:)


    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you see a reply being an answer to the question of the thread, click "Mark As Answer

    Monday, September 16, 2013 4:58 AM
  • Whenever I am trying to activate my feature, it is giving me the following error (from ULS Log):

    Feature Activation: Threw an exception, attempting to roll back.  Feature 'job2_Feature1' (ID: 'efbf425d-1907-4122-a60f-111bfd0d4504').  Exception: System.Security.SecurityException: Access denied.     at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()     at Microsoft.SharePoint.Administration.SPJobDefinition.Update()     at job2.Features.Feature1.Feature1EventReceiver.FeatureActivated(SPFeatureReceiverProperties properties)     at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)     at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)  The Zone of the assembly that failed was:  MyComputer

    Leaving Monitored Scope (Feature Activation: Activating Feature 'job2_Feature1' (ID: 'efbf425d-1907-4122-a60f-111bfd0d4504') at URL https://domain.com.). Execution Time=442.107363165458

    Access denied.

    Monday, September 23, 2013 9:35 AM
  • Are the service accounts different on the new farm?

    You will need to use an account that is a farm admin (and has rights to write to the Central admin config db) to activate the feature that is adding a new timer job (and any code in the feature receiver for that feature that may be updating the farms config db). 

    You might also get succeed in activating (depending on what the code (if any) in the feature event receiver is doing) if you enable the feature using PowerShell.


    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    I just added a webpart to the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here: Upload and Crop User Profile Photos

    Monday, September 23, 2013 10:32 AM
  • Hi Matthew,

    I have tried to login with System Account, and then I am activating the feature, but still I am getting the same error.

    Tuesday, September 24, 2013 4:22 AM
  • Anyone, please provide a solution for this issue.
    Wednesday, September 25, 2013 10:14 AM
  • Can you share the code from the FeatureActivated method with us? 

    Trevor Seward, MCC

    Follow or contact me at...
      

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Wednesday, September 25, 2013 2:34 PM
    Moderator
  • public override void FeatureActivated(SPFeatureReceiverProperties properties)
            {
                SPWeb wb = properties.Feature.Parent as SPWeb;
                if (wb == null)
                {
                    throw new SPException("Error obtaining reference to context Site ");
                }
                //  make sure the job isn't already registered
                foreach (SPJobDefinition job in wb.Site.WebApplication.JobDefinitions)
                {
                    if (job.Name == List_JOB_NAME)
                        job.Delete();
                }
                RSS listLoggerJob = new RSS(List_JOB_NAME, wb.Site.WebApplication);
                SPHourlySchedule schedule = new SPHourlySchedule();
                schedule.BeginMinute = 0;
                schedule.EndMinute = 59;
                listLoggerJob.Schedule = schedule;
                listLoggerJob.Update();
            }
            public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
            {
                SPWeb wb = properties.Feature.Parent as SPWeb;
                // delete the job
                foreach (SPJobDefinition job in wb.Site.WebApplication.JobDefinitions)
                {
                    if (job.Name == List_JOB_NAME)
                        job.Delete();
                }
            }

    Thursday, September 26, 2013 4:42 AM
  • Hi Shailesh, 

    Are you activating the feature using PowerShell, or using the UI?

    Can please try this:

    1. Logon to the SharePoint server with a Farm Admin account (an account that has access to write to the Farm config database)
    2. Activate the feature using PowerShell 


    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here: Upload and Crop User Profile Photos

    Thursday, September 26, 2013 9:12 AM
  • By activating the feature using powershell, solved the issue.
    Monday, September 30, 2013 11:46 AM
  • Great !!! it works....Thanks
    Wednesday, December 18, 2013 7:03 AM
  • I m also facing the same issue , I deployed my custom Timer job in SharePoint 2013 foundation server, successfully  activated my feature for creating timer job using powershell, restarted timer service , but my custom timer job is not listed in job defenitions or even when I run power shell command to get my custom timer job it is not there . Same solution I deployed in other 2013 sharepoint server which is not a foundation server I m able to locate my timer job. I suspect Foundation may the issue or required service may not running , help me to resolve it very critical.

    regards, paul



    • Edited by pauljustin Thursday, January 09, 2014 5:28 AM
    Thursday, January 09, 2014 5:24 AM