Start a Timer Job

Scenario/Problem: You want to start a specific timer job.

Solution: Use the Start-SPTimerJob cmdlet.

To start a timer job, execute the Start-SPTimerJob cmdlet with the Identity of the timer job or a timer job variable. Listing 4.26 shows a sample command line.

Listing 4.26. Starting a Timer Job

$timerJob = Get-SPTimerJob -Identity "DocIDEnable"Start-SPTimerJob $timerJob

In this scenario, the timer job kicks off when you start it manually. This is the same as selecting the Run Now button in Central Administration.

Tip

You cannot start a timer job that is disabled. Use Enable-SPTimerJob first to ensure that the timer job is enabled before attempting to start the job.

Get PowerShell™ for SharePoint® 2013 How-To now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.