Skip to content

Latest commit

 

History

History
127 lines (86 loc) · 3.31 KB

File metadata and controls

127 lines (86 loc) · 3.31 KB

Windows Task Scheduler Configuration

This document explains the correct configuration required for running GraphAutomation.ps1 reliably.

General Tab

  • Run whether user is logged on or not ✅
  • Run with highest privileges ✅
  • Do NOT check "Do not store password" ❌

Why? Windows runs tasks without stored passwords using a restricted token, which breaks:

  • PowerShell execution
  • Network access
  • API calls

How to setup Task scheduler

  1. On windows search bar, type "Task Scheduler".

  2. To create basic task, right click on the Task Scheduler Library and click Create Basic Task....

Create basic task

  1. Name the task and type a description and click next.

Name the task

  1. Set the Trigger to Daily in this case and click next.

Set trigger

  1. Set the start time to tell the scheduler when to start this task. Check the box for Synchronize across time zones. Click next.

Set the start time

  1. Set Start a program on Action tab. Click next.

Select action

  1. On Start a Program tab, fill below and click next.

Program/script:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add arguments:

-ExecutionPolicy Bypass -NonInteractive -File "C:\Program Files (x86)\PRTG Network Monitor\notifications\exe\GraphAutomation.ps1"

Start in:

C:\Program Files (x86)\PRTG Network Monitor\notifications\exe

Start a program

  1. Review the settings and click Finish.

Finish

  1. Then select the create task, right click and select Properties.

Properties

  1. On General tab, make sure to:
  • Check box for Run whether user is logged on or not
  • Check box for Run with highest privileges
  • Uncheck box for Do not store password. The task will only have access to local computer resources.

General

  1. On Triggers tab, make sure the Status is Enabled.

Trigger status

  1. On Settings tab and click ok.
  • Check box for Allow task to be run on demand
  • Check box for Stop the task if it runs longer than: select 1 hour
  • Check box for If the running task does not end when requested, force it to stop
  • Select Stop the existing instance under If the task is not scheduled to run again, delete it after

Settings

  1. To run the task manually, select the create task and click Run on the right side of the tab

Run

Expected results:

  • Exit code: 0x0
  • Telegram message received