|
I know this is an old topic but there is a very simple way to achieve this. In fact this method, with a few altercations, may be used to deploy any file via GP.
1) Create a share on your network
i.e. \\server\hostsDeploy\
2) Copy the 'hosts' file you wish to deploy into the share.
i.e. \\server\hostsDeploy\hosts
3) Create a file called 'deployHosts.cmd' in the shared directory.
i.e. \\server\hostsDeploy\deployHosts.cmd
4) Edit the 'deployHosts.cmd' file so that it reads:
@echo off copy \\server\hostsDeploy\hosts %SystemRoot%\system32\drivers\etc\hosts
5) Set the script to run as either a computer startup script or a user logon script within group policy.
i.e.
As a computer startup: a. In the Active Directory Users and Computers MMC snap-in, right-click the domain name, and then click Properties. b. Click the Group Policy tab. c. Click New to create a new Group Policy object (GPO), and type Hosts Deployment for the name of the policy. d. Click the new policy, and then click Edit. e. Expand Windows Settings for Computer Configuration, and then click Scripts. f. Double-click Logon, and then click Add.
The Add a Script dialog box appears. g. In the Script Name box, type \\ServerName\hostsDeploy\deployHosts.cmd. h. Click OK, and then click Apply.
As a user logon script: a. In the Active Directory Users and Computers MMC snap-in, right-click the domain name, and then click Properties. b. Click the Group Policy tab. c. Click New to create a new GPO, and then type Hosts Deployment for the name. d. Click the new policy, and then click Edit. e. Expand Windows Settings for User Configuration, and then click Scripts. f. Double-click Logon, and then click Add. The Add a Script dialog box appears. g. In the Script Name box, type \\ServerName\hostsDeploy\deployHosts.cmd. h. Click OK, and then click Apply.
NOTE: The default hosts path for Microsoft Windows (NT/2000/XP/2003/Vista) systems is '%SystemRoot%\system32\drivers\etc\'
For Microsoft Windows (95/98 and 98SE/Me) the defualt path is '%SystemRoot%'
For Unix-like systems, including Mac OS X, GNU and Linux systems the defualt path is '\etc'
|
|
Article
|
1430
|
|
Created
|
3-17-2008
|
|
Author
|
Lucki
|
|
Rating
|
(None)
|
|