Link to home
Start Free TrialLog in
Avatar of A Edwards
A Edwards

asked on

Pushing a Host File via Active Directory

Win XP
Win 2k3 server
-------------------
I have a host file that updates every so often.  I would like to push this file out to all my computers in the network via Active Directory.  All users do not have Local Admin Rights. What steps would I need to take to push this file out.  I was told it can be done with an MSI package.  I am not to familar with MSI and pushing this out.  Please give me a step by step thanks!!
Avatar of sirbounty
sirbounty
Flag of United States of America image

If you can run it from a 'management' station, using network admin credentials, and if you have a list of PCs, then something like this would work...

for /f %%a in (C:\Computers.txt) do copy %systemroot%\system32\drivers\etc\hosts \\%%a\admin$\system32\drivers\etc /y
Avatar of A Edwards
A Edwards

ASKER

What would be considered a "Management Station"?

And were would I put this script?
" for /f %%a in (C:\Computers.txt) do copy %systemroot%\system32\drivers\etc\hosts \\%%a\admin$\system32\drivers\etc /y " 
By that I mean, perhaps, your PC - one with an admin logged in to it.

you could save the above as UpdateHosts.bat
Once run (double-click it) it'll update all computers in the computers.txt file with the hosts file stored on your PC (assuming that's where the updated one is...)
Would I need to add all my computer names to that ( C:\Computers.txt )?

And Yes I have the Updated host file on my computer in the default folder.
C:\WINDOWS\system32\drivers\etc\hosts
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks man... That worked
It was so fast..
Thanks a lot for the Batch files.  You made me look like a KING!!
Can someone help me out here. I'm kinda new to all this...
I want to auto run this command to copy the hosts file to the user's computer when they logon to their account on the network.

Can anybody post in detail steps I can follow, starting with the .bat file and where to set it up.

thanks