How to delete a timer job definition
YOU SHOULD ONLY DO THESE ACTIONS ON A NON-PRODUCTIVE ENVIRONMENT
If you want to delete a Sharepoint Timer Job Definitions follow these steps:
- Get the GUID of the timer job definition with the following cmdlet:
get-sptimerjob | sort-object -property Name | ft Name, Id - stsadm.exe -o deleteconfigurationobject -id <GUID>
Comments
Anonymous
January 01, 2003
Check if just the statement Get-SPTimerJob jobName -WebApplication webApplicationName will return results. I think you might have any typo in your jobName or webapp name and thus will not get any results.Anonymous
January 01, 2003
ms-okoestner, it worked pretty well. thanks.Anonymous
January 01, 2003
yes you can delete/deactivate the timerjob/feature using jobname.delete() inside the Feature dactivation method of timerjob eventreceiver.Anonymous
February 28, 2011
Incorrect. Use: stsadm -o deletessptimerjobAnonymous
May 27, 2011
Simle way to make a Timer Job Feature for SharePoint 2010 / Cách tạo một tính năng chạy theo lịch trình cho SharePoint 2010 sharepointtaskmaster.blogspot.com/.../simle-way-to-make-timer-job-feature-for.htmlAnonymous
August 10, 2011
Thanks, saved my hide :)Anonymous
May 03, 2012
My proposal: $job = Get-SPTimerJob jobName -WebApplication webApplicationName $job.Delete()Anonymous
July 18, 2013
Job.Delete() method is throwing error while trying to remove the timer job from feature deactivating event. Error that is coming is "object reference not set to an instance of an object" stack trace in sharepoint log shows. Any idea on this. Please advice. I was able to delete the job using powershel script as mentioned by Stefan Illner at Microsoft.SharePoint.Utilities.SPSqlCommand.get_ReturnValue() at Microsoft.SharePoint.Administration.SPConfigurationDatabase.DeleteObject(Guid id) at Microsoft.SharePoint.Administration.SPConfigurationDatabase.DeleteObject(SPPersistedObject obj) at Microsoft.SharePoint.Administration.SPPersistedObject.Delete() at Microsoft.SharePoint.Administration.SPJobDefinition.Delete() at KPMG.ITSGlobal.MySite.ProfileTranslation.KPMGItsGlobalMySiteEventReceiver.<>c__DisplayClass2.<DeleteMySiteProfileTranslationJob>b__0() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)Anonymous
July 30, 2013
Hi ms-okoestner, I have checked that the name is fine and there is no Typo error. Again I'm abale to delete the Job using powershell script but not through code when deactivating a feature on site collection level.