Enable-Disable Timer Jobs using PowerShell in SharePoint
Timer jobs perform specific tasks in SharePoint through Windows Timer service, such as sending email alerts at a scheduled time. In SharePoint Central Administration site you can check the timer jobs, disable or enable specific timer jobs.
PowerShell Script to Check Timer Job Status:
How to Disable a Timer job in SharePoint?
To disable a timer job, Head on to Central Administration >> Monitoring >> Timer Jobs >> Review job definitions >> pick your target from the list of timer jobs in SharePoint 2013 >> Click on "Disable" button to disable a Timer job.
Disable SharePoint timer job using PowerShell
Activate timer job in SharePoint:
To activate a disabled timer job, Go to:
SharePoint enable timer job with PowerShell:
PowerShell Script to Check Timer Job Status:
#Function to Check Timer job status Function Get-TimerJobStatus($TimerJobName) { $TimerJob = Get-SPTimerJob | Where-Object { $_.displayname -like $TimerJobName } if($TimerJob -eq $null) { Write-host "Timer job not found!" -ForegroundColor Red return } $TimerJobDisabled = $TimerJob | Select -ExpandProperty IsDisabled if($TimerJobDisabled) { Write-host "Timer Job is Disabled!" -ForegroundColor Yellow } else { Write-host "Timer Job is Enabled!" -ForegroundColor Green } } $TimerJobName="My Site Cleanup Job" Get-TimerJobStatus $TimerJobName
How to Disable a Timer job in SharePoint?
To disable a timer job, Head on to Central Administration >> Monitoring >> Timer Jobs >> Review job definitions >> pick your target from the list of timer jobs in SharePoint 2013 >> Click on "Disable" button to disable a Timer job.
Disable SharePoint timer job using PowerShell
#Function to Disable a Timer job Function Disable-TimerJob($TimerJobName) { $TimerJob = Get-SPTimerJob | Where-Object { $_.displayname -like $TimerJobName } if($TimerJob -eq $null) { Write-host "Timer job not found!" -ForegroundColor Red return } $TimerJobDisabled = $TimerJob | Select -ExpandProperty IsDisabled if($TimerJobDisabled) { Write-host "Timer Job is already Disabled!" -ForegroundColor Yellow } else { $TimerJob | Disable-SPTimerJob Write-host "Timer Job Disabled!" -ForegroundColor Green } } #Timer job name to disable $TimerJobName="My Site Cleanup Job" #Call the function to Disable Timer job Disable-TimerJob $TimerJobName
Activate timer job in SharePoint:
To activate a disabled timer job, Go to:
- Central Administration >> Monitoring >> Timer Jobs
- Review job definitions >> pick your target from the list of timer jobs in SharePoint 2013
- Click on "Enable" button to activate the timer job.
SharePoint enable timer job with PowerShell:
#Function to Enable a Timer job Function Enable-TimerJob($TimerJobName) { $TimerJob = Get-SPTimerJob | Where-Object { $_.displayname -like $TimerJobName } if($TimerJob -eq $null) { Write-host "Timer job not found!" -ForegroundColor Red return } $TimerJobDisabled = $TimerJob | Select -ExpandProperty IsDisabled if($TimerJobDisabled) { $TimerJob | Enable-SPTimerJob Write-host "Timer Job Enabled!" -ForegroundColor Green } else { Write-host "Timer Job is Already Enabled!" -ForegroundColor Yellow } } #Timer job name to Enable $TimerJobName="My Site Cleanup Job" #Call the function to Enable Timer job Enable-TimerJob $TimerJobNameThis activates timer job in SharePoint 2010 with PowerShell.
No comments:
Please Login and comment to get your questions answered!