Schedule a PowerShell Script with SQL Server Agent
<img src="https://tictactech.net//images/intro_images/powershell-sql-agent-intro.jpg#joomlaImage://local-?width=1024&height=504" alt="Robot entering powershell event on calendar" decoding="async" loading="lazy">
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.
<a target="_blank" href="https://tictactech.net/category-blog/powershell/schedule-a-powershell-script-with-sql-server-agent" rel="noopener">Read More …</a>
https://tictactech.net/category-blog/pow...rver-agent
<img src="https://tictactech.net//images/intro_images/powershell-sql-agent-intro.jpg#joomlaImage://local-?width=1024&height=504" alt="Robot entering powershell event on calendar" decoding="async" loading="lazy">
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.
<a target="_blank" href="https://tictactech.net/category-blog/powershell/schedule-a-powershell-script-with-sql-server-agent" rel="noopener">Read More …</a>
https://tictactech.net/category-blog/pow...rver-agent