DIR SQLSERVER:\SQL\HAL9000\SQL2K8\JobServer\Jobs\Test* | % {$_.Start()}
If you have other jobs that you don't want to start just filter out the results of the
dir
command. You could also just put all the job names into a variable and iterate through a
foreach
loop using the
Start()
. Once you get the script doing what you need just create a SQL Agent job to fire it off. If you want it to happen anytime the SQL Agent service is restarted, configure the service to run PowerShell.exe and have it call the script you create. You can do this under the Services applet and go to the "Recovery" tab of the SQL Server Agent properties window. I would make sure you document how you set this up so anyone else on your team or that you work with is aware of how it is configured.
No one has followed this question yet.