How to delete a SharePoint timer job
Recently I got a problem with timer job that is there were two instances got created in central admin. One instance got created with first deployment and another instance got created with second deployment because there were some changes made in timer job. Even though, in feature deactivation event we have written a code to delete existing job but some how it's not get deleted. Now I got required to delete the old job. Unfortunately we do not have any option to delete job at central admin level. After googling I found power shell script to achieve this.
Searching listing and find timer job to delete.We need an id.
Get-SPTimerJob | where { $_.name -like “*<your search criteria>*” } |ft id,name
Get-SPTimerJob | where { $_.name -like “*<your search criteria>*” } |ft id,name
Set job to a variable
$job = Get-SPTimerJob -id <GUID>
$job = Get-SPTimerJob -id <GUID>
And delete it.
$job.Delete()
$job.Delete()
I got this information from the below blog.
Comments
Post a Comment