How to schedule a PowerShell script

Article ID: 396
Category: Application Scheduler
Applies to: 3.5 and later
Updated: 2019-09-04
  • In the management console, under 'Tools > Embedded Scripts' click 'New' and give the script a descriptive name, e.g. 'script_name.ps1' and in the 'Script Content' box add your script
  • In the 'Interpreter field', select 'powershell.exe -inputformat none -file' from the drop-down and click 'OK'
  • Under 'System Health Packages', create a new package (assign it accordingly or make it global) and then add an 'Application Scheduler' object to it
  • Decide on a schedule for the script and select @script_name.ps1 for the script name (scripts starting with the @ symbol refer to embedded scripts)

When running PowerShell scripts, also ensure that the proper execution policy is set.



Try EventSentry on-premise

FREE 30-day evaluation

Download Now