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


Stop-DbaAgentJob

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

Screenshots

dbatools-Stop-DbaAgentJob

Examples

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

Author

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

Get-Help

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