GPO script debugging.

Doria 1,246 Reputation points
2020-10-14T22:59:11.097+00:00

Hi everyone!

I set up a GPO to adjust the time zone for workstations. Here is the script file:

@Echo off
rem by Doria

%SystemRoot%\System32\tzutil.exe /s "SA Western Standard Time"
exit /b
32399-gpsvc.txt

When I run it manually on the workstation (Windows 10 Pro), it works, but when it runs at the start of the station, it doesn't work. Why? Attached is an example station's debug file, recording that it ran the script successfully (line 2020). I do not understand. What am I possibly missing?

GPO ID {72B162A0-80A6-49D2-B274-BDF92AF8381D}

Hope I was clear enough.

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,102 questions
0 comments No comments
{count} votes

Accepted answer
  1. Hannah Xiong 6,266 Reputation points
    2020-10-29T08:50:48.797+00:00

    Hello,

    Thank you so much for your feedback.

    The normal users could be able to change the time zone and have access to type the .bat as shown below.

    35953-11.png

    I did the much more tests but the startup script GPO still could not be applied successfully. And then I tried the logon script. The configuration is as shown below:

    35954-113.png

    The logon script GPO could be applied successfully and the Time Zone could be changed.

    36012-111.png

    36021-112.png

    We could try to configure the Logon script to see whether it works. Thanks for your understanding and support.

    Best regards,
    Hannah Xiong

    ============================================

    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

9 additional answers

Sort by: Most helpful
  1. Hannah Xiong 6,266 Reputation points
    2020-10-27T08:54:32.213+00:00

    Hello,

    Thank you so much for your feedback.

    I did more tests. In my environment, when the gpresult /v output reports the message, "LastExecuted: This script has not yet been run.", I checked that the policy is not applied successfully. That is to say, the function in the script does not take effect.

    But when restarting the computers, and gpresult /v output reports the last executed time of the script, the policy is applied successfully and the script takes effect.

    35239-123.png

    So we could kindly have a check whether the policies are applied successfully and the scripts take effect when it shows "LastExecuted: This script has not yet been run."

    As for the script to change the time zone, it seems to be an exception. Even though it shows the last executed time of the script, the policy is still not applied.

    35246-1234.png

    I also discussed with my colleague. The policy is also not applied successfully when this policy is configured in her AD environment. As mentioned, it is not suggested to use the startup script to change the time zone.

    Thank you so much for your understanding and support.

    Best regards,
    Hannah Xiong

    ============================================

    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

  2. Doria 1,246 Reputation points
    2020-10-28T12:45:58.55+00:00

    Thanks for your answer.

    This issue is very interesting. Well, I had already restarted the workstation I am using as a lab several times, it doesn't matter, the message always says "LastExecuted: This script has not yet been run." for all GPOs that run a script when starting the station, and all of them works except the time zone one. Strange, it doesn't make sense! But that is not the point. The question is to understand why the time zone command fails, as if the system's authentication was not sufficient to execute the command. So, if you find out the reason with your colleague, please share it with us. I'll try something else and let you know.

    Regards.

    0 comments No comments

  3. Doria 1,246 Reputation points
    2020-10-28T13:18:26.19+00:00

    On time, bingo. Look:

    35771-1.png35668-2.png

    0 comments No comments

  4. Doria 1,246 Reputation points
    2020-10-28T13:38:57.28+00:00

    Could be that?! What do you think?

    35746-3.png

    0 comments No comments