TicTacTech.net Forums
Schedule a PowerShell Script with SQL Server Agent - Printable Version

+- TicTacTech.net Forums (https://tictactech.net/forum)
+-- Forum: Technology (https://tictactech.net/forum/forumdisplay.php?fid=4)
+--- Forum: Coding and Webmastering (https://tictactech.net/forum/forumdisplay.php?fid=6)
+--- Thread: Schedule a PowerShell Script with SQL Server Agent (/showthread.php?tid=354)



Schedule a PowerShell Script with SQL Server Agent - tictactech.net - 11-16-2024

Schedule a PowerShell Script with SQL Server Agent


There are many ways to schedule a PowerShell script to run within windows. The most common way is to use task scheduler however if your PowerShell script is invoking SQL commands, I find it is best to use the SQL server agent to schedule the job. This keeps all of your database based scripts in one place. This is very important when it comes time to upgrade or migrate the server. I will go over how to schedule the script in SQL Server 2016 as well as add email notifications and output to a text file.

Read More …


https://tictactech.net/category-blog/powershell/schedule-a-powershell-script-with-sql-server-agent