Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Schedule a PowerShell Script with SQL Server Agent
#1
Robot 
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 &hellip;</a>


https://tictactech.net/category-blog/pow...rver-agent
  


Messages In This Thread
Schedule a PowerShell Script with SQL Server Agent - by tictactech.net - 09-23-2024, 07:15 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)