Knowledgebase

Scheduling PowerShell Automation Print

  • microsofttechnology, microsoft, password, permissions, guide, howto, solution, zillionkinghost
  • 0

Unattended execution in Windows environments.

WHAT OPTIONS EXIST

The task scheduler, on a server A managed cloud automation service A configuration management system

WHAT TO PROVIDE IN ANY SCHEDULED SCRIPT

Absolute paths An explicit working location Logging of what happened Clear failure signalling

WHY ABSOLUTE PATHS

Scheduled tasks run with a minimal environment, and relative paths resolve elsewhere.

WHAT THAT EXPLAINS

Scripts working when run manually and failing when scheduled.

WHAT ACCOUNT TO RUN AS

A dedicated account with the narrowest permissions, not an administrator's personal account.

WHY

Personal accounts change passwords and leave.

WHAT TO PREVENT

Overlapping runs, where one has not finished before the next starts.

WHAT TO ALERT ON

Failure The task not running at all

WHY THAT SECOND ONE

A scheduled task silently ceasing is invisible for months.

WHAT TO RECORD

Start time, end time and outcome.

WHAT TO REVIEW

The logs, rather than assuming success.

WHAT TO DOCUMENT

What runs, where, as whom, and what to do when it fails.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot