Timerjob is not working - it doesn't show up in central admin monitoring tab

Dear all,
I have enabled the timer job using the following class file and event receiver file. After enabling in powershell - the job is not appearing in job definition in central administration.
Any inputs are highly appreciated. Since I am new to SP2010 - I will then try to debug the timer job.
C# class fileusing System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
namespace TrainingTimerJobs
public class TJ_ProcessInstructorSchedules : SPJobDefinition
public TJ_ProcessInstructorSchedules() : base() { }
public TJ_ProcessInstructorSchedules(string jobName, SPService service, SPServer server, SPJobLockType targetType) : base(jobName, service, server, targetType) { }
public TJ_ProcessInstructorSchedules(string jobName, SPWebApplication webApplication) : base(jobName, webApplication, null, SPJobLockType.ContentDatabase) { this.Title = "Training Registration Portal - Process Instructor Schedules"; }
public override void Execute(Guid targetInstanceId)
//Access the Trainers list
SPWebApplication webApp = this.Parent as SPWebApplication;
SPSite trainingSite = webApp.Sites["sites/training"];
SPWeb rootWeb = trainingSite.RootWeb;
SPList trainersList = rootWeb.Lists["Trainers"];
SPListItemCollection trainers = trainersList.Items;
foreach (SPListItem trainer in trainers)
//Store the trainer's email address
string trainerEmail = trainer["E-mail Address"].ToString();
//Store the trainer's full name for future use
string trainerFullName = trainer["Full Name"].ToString();
//Access the Classes list and retrieve classes for this trainer that occur in the future
SPList classesList = rootWeb.Lists["Classes"];
SPQuery getClassesForTrainer = new SPQuery();
getClassesForTrainer.ViewFields = "<FieldRef Name='CourseTitle'/><FieldRef Name='Trainer'/><FieldRef Name='Venue'/><FieldRef Name='Registrations'/><FieldRef Name='StartDate'/><FieldRef Name='_EndDate'/>"; //CAML
getClassesForTrainer.Query = "<Where><And><Eq><FieldRef Name='Trainer' /><Value Type='Lookup'>" + trainerFullName + "</Value></Eq><Geq><FieldRef Name='StartDate'/><Value Type='DateTime'><Today /></Value></Geq></And></Where>";
SPListItemCollection classesForTrainer = classesList.GetItems(getClassesForTrainer);
//Iterate through the classes and build an email to send to the Trainer
string emailSubject = "Instructor Schedule for " + trainerFullName;
string emailBody = "";
emailBody += "Hello " + trainerFullName + ",<br/><br/>";
emailBody += "Here is your upcoming schedule. If you have any questions, please contact Judy Moore ([email protected]) or Amanda Stevenson ([email protected]).<br/><br/>";
foreach (SPListItem scheduledClass in classesForTrainer)
emailBody += scheduledClass["CourseTitle"].ToString().Remove(0, 3) + " at " + scheduledClass["Venue"].ToString() + " starting at " + scheduledClass["StartDate"].ToString() + " and ending at " + scheduledClass["_EndDate"].ToString() + ", which has " + scheduledClass["Registrations"].ToString() + " registrations.<br/>";
emailBody += "<br/>Thank you!<br/><br/>";
emailBody += "Do not reply to this message; it is an automatically generated system message.";
//Send the email
MailMessage instructorScheduleEmail = new MailMessage("[email protected]", trainerEmail, emailSubject, emailBody);
instructorScheduleEmail.IsBodyHtml = true;
SmtpClient smtpClient = new SmtpClient("inmaa3bms0036");
smtpClient.Send(instructorScheduleEmail);
}Event Receiverusing System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.Security;
namespace TrainingTimerJobs.Features.Feature_TrainingTimerJobs
/// <summary>
/// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
/// </summary>
/// <remarks>
/// The GUID attached to this class may be used during packaging and should not be modified.
/// </remarks>
[Guid("6824fc32-2347-49b2-9a85-fbe53e7c8cee")]
public class Feature_TrainingTimerJobsEventReceiver : SPFeatureReceiver
// Uncomment the method below to handle the event raised after a feature has been activated.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
if (webApp.Name == "tandoor.ifmr.co.in")
foreach (SPJobDefinition job in webApp.JobDefinitions)
if (job.Name == "Training Registration Portal - Process Instructor Schedules")
job.Delete();
TJ_ProcessInstructorSchedules tjSendSchedules = new TJ_ProcessInstructorSchedules("Training Registration Portal - Process Instructor Schedules", webApp);
tjSendSchedules.Title = "Training Registration Portal - Process Instructor Schedules";
SPWeeklySchedule weeklySchedule = new SPWeeklySchedule();
weeklySchedule.BeginDayOfWeek = DayOfWeek.Friday;
weeklySchedule.BeginHour = 16;
weeklySchedule.EndDayOfWeek = DayOfWeek.Friday;
weeklySchedule.EndHour = 17;
tjSendSchedules.Schedule = weeklySchedule;
tjSendSchedules.Update();
// Uncomment the method below to handle the event raised before a feature is deactivated.
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
if (webApp.Name == "tandoor.ifmr.co.in")
foreach (SPJobDefinition job in webApp.JobDefinitions)
if (job.Name == "Training Registration Portal - Process Instructor Schedules")
job.Delete();
// Uncomment the method below to handle the event raised after a feature has been installed.
//public override void FeatureInstalled(SPFeatureReceiverProperties properties)
// Uncomment the method below to handle the event raised before a feature is uninstalled.
//public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
// Uncomment the method below to handle the event raised when a feature is upgrading.
//public override void FeatureUpgrading(SPFeatureReceiverProperties properties, string upgradeActionName, System.Collections.Generic.IDictionary<string, string> parameters)

Hi sathyaav,
Based on your code, I suggest you debug your code step by step to see to check whether the variables are valid.
Also, I suggest you check if you have actived web application feature in Central Administartion ->"Manage Web Applications"->select web application and click manage feature in ribbon->Active your timer job.
Here is a detailed code demo for your reference:
Create and Deploy Custom Timer Job Definition in SharePoint Programatically
Best Regards
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Zhengyu Guo
TechNet Community Support

Similar Messages

  • My apple tv is not working, the only thing showing up on the screen is the apple box with a white usb cord connected to it under the hdmi plug in and next to it is an iTunes sign- how do i fix my apple tv?

    my apple tv is not working, the only thing showing up on the screen is the apple box with a white usb cord connected to it under the hdmi plug in and next to it is an iTunes sign- how do i fix my apple tv?

    Restore.

  • BB protect works but doesn't show the location

    Hello I have installed BB Protect on my 9320. I have also switched on the GPS and the Wifi too. Enabled the Protect too. But when I log on to BB account, it doesn't show me the location of the device. It says unable to track the location. But everything shows fine in the Protect account on my laptop, like I can even see the current correct battery amount. So it means the device does connect with the account but why does it not show the location. What else can I do. I really need it to be working.
    Please help. I will be very very very grateful to you. P.S.: I am with Mobilicity in Canada and the phone was purchased from Mobilicity too. Thank you. 

    Hi there,
    There is an option during the setup of BlackBerry Protect that is required to enable this ability. To fix this, go into BlackBerry Protect on the device, press the BB Menu button and select Options, then make sure Location Reporting is turned on.
    I hope that helps.
    If you want to thank someone for their comment, do so by clicking the Thumbs Up icon.
    If your issue is resolved, don't forget to click the Solution button on the resolution!

  • Sound is not working for my TV Shows

    My sound is not working for just my TV Shows. Sound for the music is just fine. I would appreciate any help given. Thanks!

    If you go back 4 pages you'll find a lot of responses about the same problem. Towards the bottom of this link to that page, Lex came up with a band-aid for the problem until iTunes gets it fixed. Lex's fix worked for me and some others. Since I did as he suggested, I have downloaded two movies and put them over to my iPod. I can also see them on my computer screen and hear them too.
    Possible Temp Help

  • Sound not working on ipad speakers, shows headphones and no headphone is plugged in.

    My sound is not working on my ipad2 speakers.  when I adjust the sound button it shows headphones, I have no headphone installed.  I tried reseting the ipad (turned off and on), reset with itunes, updated os.

    Hello,
    As per the information you have provided it appears that the audio port has been damaged. Make sure that there is no issues with the port, if there is no damage on the ports, you can get the iPad replaced under warranty.
    Resetting and restore would not work as this mostly appears to be a hardware failure.
    Thanks and regards
    Animesh

  • Links phone not working in preview but show on phone.

    Some of my links between pages on phone do not work, but do work on phone itself. Also text frame show same on design page and phone page, but differently in preview.
    what am I doing wrong?
    erin p

    Hi,
    Could you please provide a url , where we can check it. Also, how it looks like in desig view, please provide a screenshot

  • Iphone 4s, keypad sound not working, volume buttom doesnt show up or down

    Hello,
    I have bought my iphone 4s, 32gb 2 days back and i found out that the keypad sound does not work. i have gone to the setting, sound and turned on the sound of lock and keypad. However, its not working. also, the colume buttom when i click it up or down it doesnt show the bar, actually its doesnt work it shows only the symbol of sound.
    i tried to reset, restore... no results
    anyone can help me with that??
    Thanks

    I spoke with Apple and they suggested doing a restore. I did this and the sound was restored. I started installing my tweaks and programs, each time testing the sound. When I installed "Hands-Free Control" the sound issue came back. This is a tweak to allow you to control Siri without having to hold the home button. When you activate the listening option, the sound on the phone stopped working. When you turn it off, it started working again. I dont know if the rest of you are have this Cydia tweak, but that was the culprit for me.

  • HT203167 I tried the procedure to Download previously "purchased" music and it does not work. The songs show in my my previously purchased list. DETAILS Remind Me (Duet with Carrie Underwood)     4:32     Brad Paisley     This Is Country Music     Country

    How can I get all my previously purchased music.

    What do you mean by 'does not work' ? If you would like help from these user-to-user forums then more info would be useful.
    Do they songs show in the Purchased link under Quicklinks on the right-hand side of the iTunes store homepage on your computer's iTunes ? If they do, but they don't have the cloud symbol against them for redownloading, then do you still have them listed in the Music part of your library (where you would click on them to play them) ? If you do then try deleting them from there and they should then get the cloud symbol against them in Purchased for redownloading.
    If you are in a country where music can't be redownloaded,or if you've changed countries since buying them or they are no longer in your country's store (content providers occasionally remove their content), then you will need to copy them back from your backup of your downloads/library.

  • My daughters ipod is not working it is just showing a blank screen can anyone give any advice

    My daughters ipod touch is not working it just shows a blank screen.Can anyone help?

    Basics from the manual are restart, reset, restore.  Have you tried each of these?

  • LR 4.4 works but doesn't show photos?

    My computer died and needed a lot of work, including a new mother board and new graphics cards. Now LR 4.4 doesn't show photo's. LR seems to be working well in every other way but where the photos should be the spaces are blank. I vaguely remember something like this happening before but I don't remember the solution. Any suggestions?
    Thanks,
    Doug

    The drive names are the same and LR is still listing the HD names and files correctly.
    From this screen shot you can see that LR finds the files and their sizes and ratings but there are no images.

  • My phone is not working it's just showing the apple icon ???

    My phone is not working, frozen and stuck on a blank screen with the apple symbol.

    http://support.apple.com/kb/HT1808

  • HT201412 settings are not working and only searching showing on top left

    my iphone 4s not working,i can't make a call and when i pressed the setting icon it's all come up all white screen.on top left side says only 'searching'

    OK everyone - I think I figured it out!
    I had the same problems:
    - 'Searching' in upper left
    - Inability to make/receive calls
    - Inability to access the internet
    - Inability to access mail
    - Setup menu comes up blank
    - Cannot shut down/reboot by holding down top right button
    Here's what to do:
    - Hold down both the top right button and the lower middle button at the same time for a few seconds and you should see the white Apple logo appear on the screen.
    - Let go of the buttons at this point and the phone will reboot
    - When it comes back, everything should be OK
    Only other thing I notoced is that I actually watched the battery drain fromm 80% to 10% when it came back online! Very strange!

  • External speakers not working/option doesn't appear in pref panel

    My external speakers suddenly stopped working for all sounds. When I go under the system preferences --> output, it only lists headphones. The headphones do work and nothing is muted. The external speakers themselves also work on a different computer. I reset the PRAM, which did not work.
    Any help would be greatly appreciated!
    Thanks!
    iMac G4   Mac OS X (10.3.9)  

    Given the number of reports I see on macbook pro audio jack problems I get the impression that that jack is not that reliable.  Look at the More Like This section n the right for possible related issues and fixes.
    Since I have a mac pro, not a macbook pro (you posted in th wrong forum, should have been the macbook pro forum) I won't comment further than to try the software suggestion of trying a smc reset.

  • AE doesn't show up in Airport Admin or Setup

    Since upgrading to Airport 4.2 and firmware update 6.2, I cannot see my AE base station in Airport Admin or Airport Setup. I've done hard and factory resets and still no dice on either one. In Airport Admin, I can have it look for an 'other' airport, type in the IP address of the base station and the password, and it loads up the configuration fine. After the hard reset, Airport Setup Assistant saw the default wireless SSID but could not find the base station.
    I tried rolling back the firmware but still no dice. How do I roll back Airport 4.2 to 4.1? The only receipt in my Library I see is "AirportConfigApps.pkg". Is this the receipt I need to rename so the iBook thinks I don't have it so I can install Airport 4.1?

    Have you recently upgraded to 10.4.2 as well?? I had this problem (along with no speakers appearing in iTunes).
    You have a couple of options:
    - you can connect directly to the base station by selecting "Other" in the admin utility and using the ip address of the base station (try 10.0.1.1 if you don't know it).
    - you can connect your mac to the base station by ethernet cable. This fixed my problem, and when I moved the base station back to it's original location it then worked correctly in wireless mode. The problem is if you change the config wirelessly, it will go back to not working.
    - downgrade your OS to 10.4.1 or earlier
    - wait until 10.4.3 comes out and hope that it fixes some of these problems!
    Tom

  • HT1446 my battery on macbook pro will not charge, light doesn't show on connector (but works with my partners mac) and fan will not stop running.

    Help please...fan won't stop running and battery just has a cross through it on screen. Connector does not light up,

    ry resetting the SMC:
    SMC
    http://support.apple.com/kb/ht3964
    If you look at the battery in System Info, does it show as ok?

Maybe you are looking for

  • Custom report templates with the help of BI Publisher.

    Hi All, I have created custom report templates with the help of BI Publisher it is working as we excepted. refered : https://blogs.oracle.com/kyle/tags/reports But our requirement want to change the color of heading and include filters in output repo

  • Referencing currency fields in a view

    When trying to unhide currency fields of a custom extractor in RSA6, we get an error saying 'OLTP source still has errors.'  I believe the errors are associated with the unit/currency referencing of these key figures.  How did you reference the key f

  • How to restore from time machine for another user login

    I use time machine to back my computer which has multiple user login. First I set up time machine backup using User A.   I checked that User B files in the hard disk is also backed up, and I can restore using User B login. Then I changed the hard dis

  • Making the order of Songs on a burnt CD the same as on the Playlist

    I have a big problem when burning a playlist to CD. Having created the playlist the list will always play in the listed (or correct) order. However whenever I burn the playlist to a CD the order of songs turns out to be different on the CD from that

  • 7520 All In One not scanning from computer

    I have a 7520 all in one printer.  I can scan from the printer to my  computer with no problems, I can print from my computer with no  problems.  I have always been able to control scanning from my computer when I put a picture on the printer without