Check permissions required to run PowerShell scripts in Task Scheduler

Suemori Toshihiro 5 Reputation points
2023-08-10T13:40:00.8733333+00:00

I would like to configure Task Scheduler to run a PowerShell script to install updates from Windows Update on my domain controllers and member servers.

Because the Task Scheduler's run account is a member of the domain's Backup Operators group, it does have permission to run the Task Scheduler.

However, even though the task scheduler is able to finish running, none of the PowerShell scripts seem to be running.

However, if you sign in as a member of the Administrators group of the domain, match the current directory to the location of the PowerShell script, change the script execution policy with Set-ExecutionPolicy, and execute it manually, the script will work as intended. I don't think there is a problem with writing the script itself.

Is the description to set the current directory in the PowerShell script insufficient?

Or am I missing permissions to run PowerShell scripts or install Windows Updates?

Thank you for your advice.

PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,459 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 36,336 Reputation points Microsoft Vendor
    2023-09-11T09:17:33.91+00:00

    Hi,

    Have you run the script manually as a Backup Operators group member? Sometimes it requires administrator rights to install updates. You can add the Backup Operators to the local administrators and see if the script in the task can run normally.

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.