How to use this powershell script: - Launch SQL Server PowerShell ( Start -> Run -> sqlps.exe) - Copy the following powershell script and save to file (Ex c:\JobHistory.ps1) - in SQL powershell window, type in script file path ( Ex: c:\JobHistory.ps1) to run the scriptNote: replace "machine\instance" with default instance - machinename\DEFAULT named instance - machinename\instancename
1: $instance = "machinename\instancename"
2:
3: $psPath = "SQLSERVER:\SQL\$instance\JobServer"
4: dir $psPath\Jobs | foreach { $_.EnumHistory() } | where-object { $_.RunStatus -ne 1}
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified thttp://www.microsoft.com/info/cpyright.htm