magritton
9/6/2016 - 2:38 AM

This runs the SharePoint Health Analysis Job manually.

This runs the SharePoint Health Analysis Job manually.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  
#Display name of the Timer Job to Run on-demand
$TimerJobName = "Health Analysis Job"
  
#Get the Timer Job
$TimerJobs = Get-SPTimerJob | where { $_.DisplayName -match $TimerJobName}
 
foreach($TimerJob in $TimerJobs) 
 {
    Write-Host "Running:" $TimerJob.DisplayName
    $TimerJob.RunNow()
    #$TimerJob.Status
 }