Skip to content

Instantly share code, notes, and snippets.

@jeffgreenca
Created October 15, 2015 21:17
Show Gist options
  • Save jeffgreenca/6c00ca3536c75be83c8a to your computer and use it in GitHub Desktop.
Save jeffgreenca/6c00ca3536c75be83c8a to your computer and use it in GitHub Desktop.
#Run from SQL Server Powershell session SQLSERVER:\SQL\<servername>\DEFAULT\jobserver\jobs\
$badJobs = @()
gci | foreach {
if($_.jobsteps[0] -match "Primary") {
echo "JOB: $($_.Name)"
echo "Has jobstep $($_.JobSteps[0].Name)"
} else {
$badJobs += $_.Name
}
}
echo "Potentially Bad Jobs"
echo $badJobs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment