Showing posts with label TimerJob. Show all posts
Showing posts with label TimerJob. Show all posts

Friday, August 9, 2013

Delete SharePoint Timer Job using PowerShell

Below PowerShell script can be used to delete the Timer Jobs deployed in SharePoint.

Inputs:
Give the Timer Job name as input for your search.
  • Searching listing and find Timer job GUID to delete it .
                       Get-SPTimerJob | where { $_.name -like “*<your search criteria>*” } |ft id,name
  • Get the Timer job Object using the GUID we got in the previous command result and Set job to a variable
                     $job = Get-SPTimerJob -id <GUID>
  • And call the Delete() method to the Delete the timer job.
                     $job.Delete()

Execute SharePoint Timer Job using PowerShell

Below PowerShell script can be used to execute the Hidden Timer Jobs in Central Administration Timer Job Definitions list.

Inputs:
WebApplication url : url of the Web application to which the timer job is added.
Timer Job name : name of the Timer Job

$webApp = Get-SPWebApplication "http://site:portnumber/
$job = $webApp.JobDefinitions | Where-Object { $_.Name -eq "Timer Job name"}
$job.Execute([System.Guid].GUID)

Get SharePoint Timer job using PowerShell

Below PowerShell script can be used to identify the Hidden Timer Jobs in Central Administration Timer Job Definitions list.

Inputs:
WebApplication : name of the Web application to which the timer job is added.
Identity : name of the Timer Job
Get-SPTimerJob -WebApplication "SharePoint - 1234" -Identity "TimerJobName"
Related Posts Plugin for WordPress, Blogger...