Schedule Powershell Script to run on a windows server using Task Scheduler

Here are the steps to Schedule Powershell Script to run on a schedule in any windows Server.

1. Open Windows Task scheduler from Administrative tools.
2. Right click on Task Scheduler Library and Select Create a task.
3. Under General tab, Enter the name of the task and update Security options.Task scheduler
4. Click on Change User or Group button to run the task as a different user or service account. If the task is scheduled to run as different user other than logged in user, password for that other account should be entered at the end.
5. Select Triggers tab, click New to add a new trigger for scheduling the task.Update day and time settings for the job to run.Task Scheduler - Triggers tab
6. Next, select Actions tab, click New to select the action to be performed by this task.Task scheduler - Actions tab
7. Select Start a Program in Action drop-down. Select PowerShell for Program/Script option. (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)schedule powershell script to run on windows server
Next, in Add arguments box, enter the name of your script along with location/path. Example: C:\Scripts\myscript.ps1
8. In Conditions and Settings tab, make any desired changes and click ‘OK’.
9. At this point, if you have selected to run the script with any other account other than currently logged in account, you will be prompted for password here.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Find all Private channels in a Team

Private channel in a team is an access controlled space available only for Owners and Members of the channel. Guests can be added to private channel as long as they are already member of the team. This should do for a quick intro about private channels. Well, the point of this post is it not […]

Read More

Disable feedback surveys in Power Platform

If you have worked in Microsoft 365 PowerApps or Power Automate, you might be familiar with feedback survey which pops up quite often. Microsoft wants your feedback on how likely are your to recommend Power Automate to a friend or colleague? Well, I ran into a conversation in twitter about this survey. Apparently I learnt […]

Read More

Error handling in Azure PowerShell Runbooks

Error handling in Azure PowerShell Runbooks should be handled carefully if not the runbook with continue to Completed state even if there is an Error in the script. Unlike exception, Runbook execution will continue after  an Error  by default. Windows PowerShell has multiple streams of output. Runbooks in Azure work differently in each of these […]

Read More