Scheduled Task permission issues

Bühler Gabriel 71 Reputation points
2023-03-22T15:02:26.2066667+00:00

Hello Everyone

I am having an issue with an ongoing Scheduled task for a Powershell Script. I am only able to run the task when I User who belongs to the Domain Administrator Group, but I cannot let it run with the SYSTEM-User or a User with local administrator permissions. The task immediately ends and he does not run the script.

User's image

Here are my settings:
User's image

User's image

The action starts the Powershell-EXE and the Argument is the path to the script itself.

Both Users (SYSTEM USER and the local User with local Administrator Rights) have full access to the Folder of the script.

Do you may know what the issue could be ?

Thank you for your help.

Kind regards,

Gabriel

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,484 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,108 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 32,081 Reputation points
    2023-03-23T00:49:09.0366667+00:00

    The D drive needs to be a local drive. It cannot be a mapped network drive.

    Create a folder C:\Temp. Grant everyone full control.

    Create a file C:\Temp\MyScript.bat. In it put the powershell command that executes the script.

    Change the task to execute cmd.exe instead of powershell.exe.

    Change the arguments of the script to this:

    /c c:\Temp\Myscript.bat 1>c:\temp\MyScript.log 2>&1
    

    That will capture stdout and stderr. Run the task. Check the contents of the log file for errors in the script output.