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


Start-DbaAgentJob

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

Screenshots

dbatools-Start-DbaAgentJob

Examples

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

Start-DbaAgentJob -SqlInstance localhost

Starts the cdc.DBWithCDC_capture SQL Agent Job on sql2016.

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

Starts the cdc.DBWithCDC_capture SQL Agent Job on sql2016.

Start-DbaAgentJob -SqlInstance sql2016 -Job cdc.DBWithCDC_capture

Restarts all failed jobs on all servers in the $servers collection

$servers | Find-DbaAgentJob -IsFailed | Start-DbaAgentJob

Author

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

Get-Help

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

Source Code

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

Related commands