I am currently adding a Property to my Timerjob in FeatureActivated via C#. This is my code.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWebApplication wa = properties.Feature.Parent as SPWebApplication;
foreach (SPJobDefinition job in wa.JobDefinitions)
{
if (job.Name == Const.TIMERJOBS_COMPSYNC_JOB_NAME)
job.Delete();
}
Core.Timerjobs.CompetitorSyncJob competitorSyncJob = new Core.Timerjobs.CompetitorSyncJob(Const.TIMERJOBS_COMPSYNC_JOB_NAME, wa);
SPHourlySchedule schedule = new SPHourlySchedule();
schedule.BeginMinute = 0;
schedule.EndMinute = 59;
competitorSyncJob.Schedule = schedule;
competitorSyncJob.Properties.Add(Const.TIMERJOBS_COMPSYNC_JOB_NAME, "http://sp2013/sites/mysite");
competitorSyncJob.Update();
}
I couldnt find a way to do this via Powershell. I have to do this to be able to change settings between development, staging and production.