how to push down a hosts file to a group of public access computers

I am trying to push down a hosts file to a group of public access computers and I'm having a tough time with the security. The login script won't run the batch file to replace the hosts file. Anyone have a solution to this? We run kixscripts currently
johnbowdenAsked:
Who is Participating?
 
DonNetwork AdministratorCommented:
0
 
DonNetwork AdministratorCommented:
Just run it as a startup script
0
 
DonNetwork AdministratorCommented:
The startup script will run in the "system" context and give it permission, whereas running as a login script the user probably didnt have the needed permissions.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
johnbowdenAuthor Commented:
this is the batch file called updatehost.bat

xcopy \\server1\netlogon\hostsfile\hosts "%systemroot%\system32\drivers\etc\" /C /H /R /Y

so you're saying to add this Active Directory Group Policy Management, Edit or create a GPO, and double-click on User Configuration --> Windows Settings --> Scripts (Logon/Logoff) --> Logon

I can't get the batch file to run
0
 
DonNetwork AdministratorCommented:
NO, add this to

COMPUTER CONFIGURATION>>>WINDOWS SETTINGS>>> SCRIPTS(startup/shutdown)
0
 
johnbowdenAuthor Commented:
Ok, still it doesn't work.
0
 
DonNetwork AdministratorCommented:
did you try running gpupdate /force /boot
0
 
johnbowdenAuthor Commented:
yes and it still doesn't work. the hosts fill is left untouched.
0
 
DonNetwork AdministratorCommented:
does the .bat run on client machine manually?
0
 
johnbowdenAuthor Commented:
the batch file runs fine on the client computers as long as it is logged in as administrator or equivelent
0
 
DonNetwork AdministratorCommented:
Does netlogon have "Authenticated Users" in NTFS permissions? if not this is why the startup script route is failing
0
 
johnbowdenAuthor Commented:
yes, authenticated users are set there. R&E, List, Read
0
 
DonNetwork AdministratorCommented:
try changing it from a .bat to .cmd
0
 
johnbowdenAuthor Commented:
dstewartjr, I tried the vbs script and it fails with the following;

Script: C:\temp\updatehost.vbs
Line: 20
Char: 17
Error: Subscript out of range: '[number: 1]'
Code: 800A0009
Source: Microsoft VBScript runtime error
0
 
johnbowdenAuthor Commented:
so I've created a GPO for the script to start up. In the start up properties, I've selected the following;
\\domain.local\SysVol\domain.local\scripts\HostsFile\updatehost.cmd
and saved the GPO.

On the Startup Properties Script tab, I click on 'Show Files' nothing shows up in that directory. That directory is as follows;
\\domain.local\SysVol\domain.local\Policies\{7508CA65-B810-44BD-8198-741751966E86}\Machine\Scripts\Startup

Should I be copying those two files (hosts file and updatehost.cmd) into that directory?
0
 
DonNetwork AdministratorCommented:
You MUST post the solution that you arrived at.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.