You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
I was wondering how would i put the script in a GPO environment?
Would i need to edit the bat file ex: the compression part change the default from 1 to 9
and adding the categories?
You don't need to change the script at all. You can create scheduled tasks with group policies that work exactly the same way that the standard scheduled tasks work. I always recommend that you just create a regular local scheduled task using the script, and then just open your task scheduler (taskschd.msc) and look at the "Unified Hosts AutoUpdate" task and use that as a model. The script location will just be that of a shared network location (\\Share), instead of a location on the local machine. And the arguments/parameters are where you put the URL and compression level, and whatever other preferences you want, like logging, etc.
CHANGE THE VERSION FILE!!!
As taken from the README:
If you are deploying the update script across an organization via a shared network location and group policies, edit the "VERSION" file by adding an X to the end of the version number like this:
1.10X
This will disable the script from checking for script updates and attempting to update itself. This does not affect updates to the hosts file or whatever scheduled tasks you may have in place, this strictly disables the Hosts_Update.cmd from updating itself within the shared network location which remote system accounts running the scheduled tasks may not have write access to.
I actually get this question a lot via e-mail, so I'll pin this for future reference. Thanks for asking.
Activity
ScriptTiger commentedon Jun 6, 2022
You don't need to change the script at all. You can create scheduled tasks with group policies that work exactly the same way that the standard scheduled tasks work. I always recommend that you just create a regular local scheduled task using the script, and then just open your task scheduler (taskschd.msc) and look at the "Unified Hosts AutoUpdate" task and use that as a model. The script location will just be that of a shared network location (
\\Share), instead of a location on the local machine. And the arguments/parameters are where you put the URL and compression level, and whatever other preferences you want, like logging, etc.CHANGE THE VERSION FILE!!!
As taken from the README:
I actually get this question a lot via e-mail, so I'll pin this for future reference. Thanks for asking.
ScriptTiger commentedon Jun 12, 2022
Haven't heard any follow-up, so going to assume this one is resolved. If not, feel free to let me know. Again, thanks for the question!