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 copies jobs from one SQL Server to another. By default, all jobs are copied.

The -Job parameter is auto populated for command-line completion and can be used to copy only specific jobs.

If the job already exists on the destination, it will be skipped unless -Force is specified. Force drops and recreates the object. Dependencies are not currently copied over.


To copy all jobs from sqlserver2014a to sqlcluster, using integrated (Windows) authentication. If jobs with the same name exist on sqlcluster, they will be skipped.


To copy only two jobs, dbjob1 and murrringjob, from sqlserver2014a to sqlcluster, using SQL authentication for sqlserver2014a and integrated (Windows) authentication for sqlcluster. If a job with the same name exists on sqlcluster, it will be dropped and recreated because -Force was used.


To see what would happen if the command were executed. No actions are actually performed.



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

Source Code

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

Related commands