question

jazpar avatar image
jazpar asked

Powershell execute batch job on remote server in sql agent

Hi On server SQL01 I have some SSIS packages run by the SQL agent. I need to execute a bat file on server SQL02. For test purpose I have this in a bat (sp1) file named TestBatJob.sp1): dir \\SQL02\Temp\ > list.txt If I on SQL01 manualle in powershell enter these lines the bat job is executed: enter-pssession -computername DKLEMSQL02 cd \\SQL02\Temp \\SQL02\Temp\TestBatJob.sp1 How can make this work automatically either by a ssis package or a manually created DSTX package ? I'm a novice to powershell, I tried follow exam,ples of ssis packages doing this without luck, so I hope someone out there have a suggestion.... BR Jan
powershellpackageexecute
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.