dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Get-DbaRunningJob

This function returns agent jobs that active on the SQL Server intance when calling the command. The information is gathered the SMO JobServer.jobs and be returned either in detailed or standard format.

Screenshots

get-dbarunningjob

get-dbarunningjob2

Examples

To return any active jobs on the SQL Server named sql2014

Get-DbaRunningJob -SqlServer sql2014

To return a detailed output of any active jobs on the SQL Server named sql2014

Get-DbaRunningJob -SqlServer sql2014 -Detailed

To return details on all active jobs on multiple instances piped into the function for every server listed in the Central Management Server on sql2016

Get-SqlRegisteredServerName -SqlServer sql2016 | Get-DbaRunningJob -Detailed

Author

This command was created by Stephen Bennett. You can find Stephen on his blog and on LinkedIn.

Get-Help

From PowerShell, execute Get-Help Get-DbaRunningJob -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaRunningJob.ps1 on GitHub
 

Related commands