Tag Info

New answers tagged

0

Yes, this way even normal users will be able to start a timer job. SPSite site = new SPSite("http://site"); foreach (SPJobDefinition job in site.WebApplication.JobDefinitions) { if (job.DisplayName.Equals("TimerJobName")) { job.Execute(Guid.Empty); ...


0

Yes you can do that but users and application pool in a site collection do not have rights to start a timer job.You need Farm administrator permission. foreach (SPJobDefinition job in site.WebApplication.JobDefinitions) { if (job.Name == "JobName") { var strStatus = job.Status; // THE ...


0

create a custom list or file to LOG just one entry for your timerjob. schedule your timer job to run based on SPMinuteSchedule once in an hour. so basically it will run every hour but before you run actual task, LOG in your list or file that it is starting up for the 1st time. you can log date and time as well. next time when it will run, check the log entry ...


1

Do you care what hours it runs at as long as it is a 3 hour interval? You could have your job scheduled to run every hour. When it runs, get the current hour and use a modulo operation (https://en.wikipedia.org/wiki/Modulo_operation) to see if it is a multiple of 3. For e.g. 1 mod 3 = 1, don't run. 2 mod 3 = 2, don't run. 3 mod 3 = 0, run. 4 mod 3 = 1, ...


0

Use the timerjob properties collection and retrieve it in the Execute method of timerjob follow below url contains solution: http://adicodes.com/timer-job-in-sharepoint-for-specific-site/ Code in the feature activated event store the siteUrl string key = "mySiteUrl"; string value = web.Url; TimerJob tmrJob = new TimerJob(webApp); //remove the key if ...


0

First off, read this article: Create and Deploy Custom Timer Job Definition in SharePoint Programatically It's a good beginners guid, taking you through the steps of creating a timerjob, what code goes where, and how to deploy the timerjob properly. All the code for deleting stuff about the employee should go in the Execute method. A good step-by-step ...



Top 50 recent answers are included