Saturday, 9 November 2013

Custom Sharepoint timer jobs are not displaying in the Central Administration

Recently i have an issue in our Custom Timer jobs. So we fixed that issue and tried to start timer job manually for testing. But in Central Admin--> Monitoring--> Job Definitions  here i could not see the custom timer jobs.
But in back end timer jobs are running and i could see the updates in SharePoint lists.

Reason:
When you deploy the WSP solution using STSADM or POWERSHELL it will be deployed only to those servers which have WFE role. Application servers may not have WFE role. So if your app server is not WFE, custom assemblies won’t be installed to its GAC.

For workaround you can follow the below methods.
 
Method 1: Using powershell script deactivate the features and again enabled it. Now you could see the timer jobs in Job History not in Job definitions. Previously even the jobs not appearing in job history also.
 
See method 2, if you want to display the custom timer jobs in job definitions to start manually.
 
Method -2: Application servers should have the timer job dlls in the assembly. For this add the dll's to GAC.
  1. Manually if you try to add the dll's to GAC you will see the access denied error. To fix this please see this Manually how to install an Assembly into the GAC without gacutil
Once you add the dll's to application server gac perform iisreset. Now can see the custom timer jobs in central admin farm.

NOTE: These dlls won't be updated next time you upgrade the solution. Because solutions are not upgraded automatically on the server without WFE role. Again manually you will need to add the dlls to application server GAC.

In SharePoint 2010 environment based on the active services, will decide what is the application servers and what is the wfe's. WFE's will have the service 'SharePoint Foundation Application' in turn on mode. 
In Application server this service will be inactive mode .
So you will need to activate the same service in Application server also. So the application server will have the WFE role. Then you can see the custom timer jobs in central admin farm.
For detailed explanation see this link

Manually how to install an Assembly into the GAC without gacutil

In Production (APP/WFE) server we may not have Visual Studio installed in, and we don't have gacutil.exe. In worst cases manually if you need to add the dll's to GAC for workaround you can follow the below steps.

1. Start--> Local Security Policy --> Local Policies --> Security Options --> and right click on the 'User Account Control: Run all administrators in Admin Approval Mode' and disabled it.


You should restart the Server to turn off the UAC Admin mode.
2. Add the dll's to (drag and drop) assembly(C:\windows\assembly\)
3. Once you add the dlls to gac again enable the UAC admin mode and restart the server.