Geeks With Blogs

News invisible hit counter View My Stats
Technical Speaking

When you develop a custom SharePoint Timer Jobs sometimes you may need to delete junk jobs created by deployment times. This article will explain you how to remove custom timer job.

About Timer Job:

A timer job runs in a specific Windows service for SharePoint 2013. Timer jobs perform infrastructure tasks for the Timer service, such as clearing the timer job history and recycling the Timer service. Timer jobs also perform tasks for web applications, such as sending email alerts.

How to remove by C# Code: You must use a Visual studio project to create timer job where you will uncomment the following code  from TimerJobFeature1.EventReceiver.cs

       // Uncomment the method below to handle the event raised before a feature is deactivated.
        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
            SPSite site = properties.Feature.Parent as SPSite;
            // delete the job   
            foreach (SPJobDefinition job in site.WebApplication.JobDefinitions)
                if (job.Name == List_JOB_NAME)

Then You will Retract the solution. Timer job will be removed from the Timer Job List.


How to remove by PowerShell Command:

Find timer job ID by List_JOB_NAME using command.

Get-SPTimerJob | where { $ -like "*<List_JOB_NAME>*" } |ft id,name

Set job to a variable
$job = Get-SPTimerJob -id <GUID>

And delete it.

Hope This will help you.


Find more reference:
Posted on Friday, April 12, 2013 4:55 PM Sharepoint 2007 | Back to top

Comments on this post: Multiple way of deleting Custom Timer job

# re: Multiple way of deleting Custom Timer job
Requesting Gravatar...

do you know how we can have timer job with the same name? in my scenario whenever i m activating feature i m checking if there exists any timer job with same name remove it then add new one. But today i saw two timer jobs with the same name. Exact same name. do you know the reason behind it?
Left by Syed Shoaib Adil on Apr 26, 2014 2:32 AM

Your comment:
 (will show your gravatar)

Copyright © MJ Ferdous | Powered by: