Hello,
Thank you so much for posting here.
According to our description, the script could run locally and it works perfectly. Since it is configured via GPO, we could have a check whether the configuration is correct and whether the GPO is applied successfully to the machines.
Have we created an OU and add the machines to this OU? Besides, have we linked the GPO to this OU?
We could check by running “gpresult /h” to get a detailed group policy result report, then check if the specific settings get applied or not.
For computer configuration:
Logon one machine and open CMD, run as administrator. Type gpresult /h C:\report.html and click Enter. Open report file to check the policies under Computer Details.
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.