Skip to main content
added 131 characters in body
Source Link
Kin Shah
  • 62.4k
  • 6
  • 122
  • 241

Another way is to just export to file using dbatools

Get-DbaAgentJob -SqlInstance workstation\sql2016 |  Export-DbaScript

you can even script out your entire instance or subset including agent jobs, operators, logins, etc for disaster recovery purpose.

Edit: Above will have the flexibility to filter out jobs that you do not need. Backup / restore of msdb is all jobs.. just FYI.

Another way is to just export to file using dbatools

Get-DbaAgentJob -SqlInstance workstation\sql2016 |  Export-DbaScript

you can even script out your entire instance or subset including agent jobs, operators, logins, etc for disaster recovery purpose.

Another way is to just export to file using dbatools

Get-DbaAgentJob -SqlInstance workstation\sql2016 |  Export-DbaScript

you can even script out your entire instance or subset including agent jobs, operators, logins, etc for disaster recovery purpose.

Edit: Above will have the flexibility to filter out jobs that you do not need. Backup / restore of msdb is all jobs.. just FYI.

Source Link
Kin Shah
  • 62.4k
  • 6
  • 122
  • 241

Another way is to just export to file using dbatools

Get-DbaAgentJob -SqlInstance workstation\sql2016 |  Export-DbaScript

you can even script out your entire instance or subset including agent jobs, operators, logins, etc for disaster recovery purpose.