Batch file of a scheduled task through GPO not working, it works when launched manually

RRphotography 21 Reputation points
2021-09-05T22:13:01.817+00:00

Hello,
I have setup a GPO to deploy a scheduled task which runs a batch file available at server level.
The batch has been saved in both these locations:

I first tried with this:
\servername\shared_folder\scripts

then this:
\servername\SYSVOL\domain_name\scripts

The task is available at the domain computer client after the gpupdate /force command. Unfortunately, it doesn't work, I mean either at the scheduled time or by running it manually through the RUN button in the scheduler task app.
But... If I launch manually the batch file through the file explorer app, it works.

I cannot understand which kind of errors there are.

Here are the task details:

129349-task-1.png
129407-task-2.png

NT AUTHORITY\SYSTEM has FULL CONTROL at the folder (and file) where the batch file is stored.

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,663 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,171 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Limitless Technology 39,371 Reputation points
    2021-09-06T10:39:03.737+00:00

    Hello R99photography

    The default locations should be:

    %SystemRoot%\SYSVOL\sysvol\<domain DNS name>\scripts.

    or

    %SystemRoot%\SYSVOL_DFSR\sysvol\<domain DNS name>\scripts (for DFS-Based FRS since as is recommended from Server 2012R2 and avobe)

    If still don't run I would try to enable the synchronous load in the GPO:
    "User Configuration -> Policies -> Administrative Templates -> System -> Scripts" to "Enabled

    Also the logon delay settings at: Configure Logon Script Delay setting to Disabled in the Computer Configuration ->Administrative Templates ->System ->Group Policy

    0 comments No comments

  2. MotoX80 31,816 Reputation points
    2021-09-06T12:15:48.31+00:00

    If the script is local to the machine, don't use a UNC path (\server\share), point directly to the drive. C:\MyData\Scripts\myScript.bat.

    If you are trying to run a task on a workstation, and pull the script from a server over the network, then you will need to insure that the AD account for the machine (YourDomain\WorkStation1$) has access on both the share permissions and file permissions on the server since you are running the task as SYSTEM.

    0 comments No comments

  3. Greg Childers 16 Reputation points
    2022-02-08T15:51:49.433+00:00

    no luck getting this to work, nothing shows under scheduled task