GPO script debugging.

Doria 1,241 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.
4,529 questions
0 comments No comments
{count} votes

Accepted answer
  1. Hannah Xiong 6,221 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,221 Reputation points
    2020-10-15T02:50:49.337+00:00

    Hello,

    Thank you so much for posting here.

    According to our description, we created a GPO for startup that will run the script. But the GPO is not applied. As for the GPO issue, first please make sure there is no problem with the configuration. Then to check the GPO is applied or not, we could run gpresult /h C:report.html to get the result report.

    Have we checked the result report whether the GPO is applied or not? As mentioned, we have enabled the gpsvc debug logging. So we could use the GPSVC analysis blog to get further:
    https://learn.microsoft.com/en-us/archive/blogs/askds/a-treatise-on-group-policy-troubleshootingnow-with-gpsvc-log-analysis

    Please note: Due to forum rules and security considerations, please do not share some private data information here.

    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,241 Reputation points
    2020-10-21T12:55:13.467+00:00

    Thanks for your answer.

    Excellent article for troubleshooting. Excellent indeed! I know that the objective of the forum is not to solve the problem, but to guide, however through the log file I identified the process ID and the thread ID and monitored through the Process Monitor the execution of the extension and found no error. Is there some way to capture the result of the command that is in the script (%SystemRoot%\System32\tzutil.exe /s "SA Western Standard Time") during the machine's initialization, because when I, as a user, execute the command there is no error, but when the machine executes something happens and I can't see it. :-(

    Look:

    34072-1.png34073-2.png34074-3.png

    0 comments No comments

  3. Hannah Xiong 6,221 Reputation points
    2020-10-22T08:41:09.25+00:00

    Hello,

    Thank you so much for your kindly reply.

    We are trying to solve the problem here. But due to data security consideration, it is better to not share private information in public. So we could delete the private information. From our gpsvc debug log file, it is hard to tell why the group policy is not applied.

    I did the test to configure the startup script to change the time zone. The startup script could be run manually on the computer to successfully change the time zone. The same as your issue, if running at the start of the computer, it did not work.

    34238-2.png

    Then I checked the gpresult /v and it showed that "This script has not yet been run". We could kindly have a check of the gpresult report.

    34225-1.png

    As per my research, it is not recommended to use the startup script to change the time zone. It is suggested to use different solution. We could refer to the following similar case.

    https://social.technet.microsoft.com/Forums/en-US/726a7873-366a-4632-b349-bd3b1e03a326/tzutil-s-change-time-zone-via-gpo-startup-script-does-not-work?forum=winserverGP

    Hope the information is helpful. For any question, please feel free to contact us.

    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

  4. Doria 1,241 Reputation points
    2020-10-26T18:23:51.403+00:00

    Hi Hannah Xiong!

    I'm sorry for the late reply. So you simulated the same problem as mine. Great! Now the point is to understand why it doesn't work. I ran the command that you asked me and the result is shown in the image below. Funny thing is that other scripts that are known to work also report the same message, "LastExecuted: This script has not yet been run." Weird! Is this message reliable?

    34998-untitled.png

    0 comments No comments