Tag Info

New answers tagged

0

This question is same as yours. as stated in this question you can create another timer job to set some flag status and run your actual timer job. To run a Timer Job a user must have Farm Admin rights, so even writing the code to run in elevated privileges will not work either.


0

You need to create a normal timer job which would be created using an empty sharepoint project and inheriting the SPJobDefinition(). Once this class is inherited, you would need to override the Execute() where you have to put all your logic. Go to the Solution Explorer and Add a new Feature. Here you would need to define @ what intervals do you want ...


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

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 ...


2

I finally figured out what was wrong. It was our old web application, maybe it somehow got damaged during the server crash. So I created a new web application and tested the timer there. It worked fine. Hope this can help somebody out there.


1

This is a very silly alternative but it has worked for me many times when I have faced a similar situation. Create a new timer job with a new name copying all the logic from this timer job and deploy it. Most probably it will work.


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