dbatools is a free PowerShell module with over 300 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


This command stops a job then returns connected SMO object for SQL Agent Job information for each instance(s) of SQL Server.




Stops all running SQL Agent Jobs on the local SQL Server instance.

Stop-DbaAgentJob -SqlInstance localhost

Stops the cdc.DBWithCDC_capture SQL Agent Job on sql2016.

Get-DbaAgentJob -SqlInstance sql2016 -Job cdc.DBWithCDC_capture | Stop-DbaAgentJob

Stops the cdc.DBWithCDC_capture SQL Agent Job on sql2016.

Stop-DbaAgentJob -SqlInstance sql2016 -Job cdc.DBWithCDC_capture


This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.


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

Source Code

Want to see the source code? View Stop-DbaAgentJob.ps1 on GitHub

Related commands