Discussion:
Adding a host file via group policy
(too old to reply)
Haroon Malik
2008-02-23 10:39:00 UTC
Permalink
Dear All,

I want to deploy a host file via group policy. Can someone help me out on
how to do this.

I dont want to use DNS as this host file is for a legacy application which
doesnt look at DNS and only refers to the local host file.

Please help.
--
Haroon Malik

Systems Engineer
Marcin
2008-02-23 12:47:56 UTC
Permalink
You can incorporate a command copying it from a central location into the
computer startup script...

hth
Marcin
Haroon Malik
2008-02-23 13:24:01 UTC
Permalink
Does it need admin rights as well on the machine. Can you give me a sample
script.

Regards,
--
Haroon Malik

Systems Engineer
Post by Marcin
You can incorporate a command copying it from a central location into the
computer startup script...
hth
Marcin
Florian Frommherz [MVP]
2008-02-23 13:45:41 UTC
Permalink
Howdie!
Post by Haroon Malik
Does it need admin rights as well on the machine. Can you give me a sample
script.
A computer startup script will run in the SYSTEM context and therefore
has sufficient privileges to copy a file into the folder. The script can
be as simple as the following batch command:

copy \\server\share\hosts %windir%\system32\drivers\etc\hosts

cheers,

Florian
--
Microsoft MVP - Windows Server - Group Policy.
eMail: prename [at] frickelsoft [dot] net.
blog: http://www.frickelsoft.net/blog.
Haroon Malik
2008-02-24 10:08:00 UTC
Permalink
HI,

It only works if you are a local admin on the machine. How can i make it
work. I am doing it as a user logon script.

Please help
--
Haroon Malik
Post by Haroon Malik
Does it need admin rights as well on the machine. Can you give me a sample
script.
Regards,
--
Haroon Malik
Systems Engineer
Post by Marcin
You can incorporate a command copying it from a central location into the
computer startup script...
hth
Marcin
Florian Frommherz [MVP]
2008-02-24 11:01:33 UTC
Permalink
Howdie!
Post by Haroon Malik
It only works if you are a local admin on the machine. How can i make it
work. I am doing it as a user logon script.
As I wrote before: don't do that as a user logon script but a computer
startup script:

Computer Configuration\Windows Settings\Scripts - Startup. - It'll run
under the SYSTEM context and has therefore sufficient privs.

cheers,

Florian
--
Microsoft MVP - Windows Server - Group Policy.
eMail: prename [at] frickelsoft [dot] net.
blog: http://www.frickelsoft.net/blog.
Haroon Malik
2008-02-24 12:22:00 UTC
Permalink
Hi Florian.

I tried that and it doesnt works. I managed to do a work around. I created
another GPO which gives everyone modify permissions to hosts file. This is
under security and File System.
--
Haroon Malik
Post by Haroon Malik
HI,
It only works if you are a local admin on the machine. How can i make it
work. I am doing it as a user logon script.
Please help
--
Haroon Malik
Post by Haroon Malik
Does it need admin rights as well on the machine. Can you give me a sample
script.
Regards,
--
Haroon Malik
Systems Engineer
Post by Marcin
You can incorporate a command copying it from a central location into the
computer startup script...
hth
Marcin
Mukunthan Seshadri
2010-08-02 22:48:38 UTC
Permalink
Hi Malik,

I am Looking for a similar kindl of solution. Can you pls explain in detail about the configurations that you did.

Cheers!!
Sesh



HaroonMali wrote:

Hi Florian. I tried that and it doesnt works. I managed to do a work around.
24-Feb-08

Hi Florian

I tried that and it doesnt works. I managed to do a work around. I created
another GPO which gives everyone modify permissions to hosts file. This is
under security and File System
--
Haroon Mali


"Haroon Malik" wrote:

Previous Posts In This Thread:

On Saturday, February 23, 2008 5:39 AM
HaroonMali wrote:

Adding a host file via group policy
Dear All

I want to deploy a host file via group policy. Can someone help me out on
how to do this

I dont want to use DNS as this host file is for a legacy application which
doesnt look at DNS and only refers to the local host file

Please help

--
Haroon Mali

Systems Engineer

On Saturday, February 23, 2008 7:47 AM
Marcin wrote:

You can incorporate a command copying it from a central location into the
You can incorporate a command copying it from a central location into th
computer startup script..

ht
Marcin

On Saturday, February 23, 2008 8:24 AM
HaroonMali wrote:

Does it need admin rights as well on the machine.
Does it need admin rights as well on the machine. Can you give me a sampl
script

Regards
-
Haroon Mali

Systems Enginee

"Marcin" wrote:

On Saturday, February 23, 2008 8:45 AM
Florian Frommherz [MVP] wrote:

Howdie!
Howdie

Haroon Malik schrieb

A computer startup script will run in the SYSTEM context and therefore
has sufficient privileges to copy a file into the folder. The script can
be as simple as the following batch command

copy \\server\share\hosts %windir%\system32\drivers\etc\host

cheers

Floria
--
Microsoft MVP - Windows Server - Group Policy
eMail: prename [at] frickelsoft [dot] net
blog: http://www.frickelsoft.net/blog.

On Sunday, February 24, 2008 5:08 AM
HaroonMali wrote:

HI,It only works if you are a local admin on the machine.
HI

It only works if you are a local admin on the machine. How can i make i
work. I am doing it as a user logon script

Please hel

-
Haroon Mali


"Haroon Malik" wrote:

On Sunday, February 24, 2008 6:01 AM
Florian Frommherz [MVP] wrote:

Howdie!
Howdie

Haroon Malik schrieb

As I wrote before: don't do that as a user logon script but a computer
startup script

Computer Configuration\Windows Settings\Scripts - Startup. - It'll run
under the SYSTEM context and has therefore sufficient privs

cheers

Floria
--
Microsoft MVP - Windows Server - Group Policy
eMail: prename [at] frickelsoft [dot] net
blog: http://www.frickelsoft.net/blog.

On Sunday, February 24, 2008 7:22 AM
HaroonMali wrote:

Hi Florian. I tried that and it doesnt works. I managed to do a work around.
Hi Florian

I tried that and it doesnt works. I managed to do a work around. I created
another GPO which gives everyone modify permissions to hosts file. This is
under security and File System
--
Haroon Mali


"Haroon Malik" wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
ASP.NET Providerless Custom Forms Authentication, Roles and Profile with MongoDb
http://www.eggheadcafe.com/tutorials/aspnet/27f836b7-2c9e-4942-9712-1c7b901cadcc/aspnet-providerless-custom-forms-authentication-roles-and-profile-with-mongodb.aspx
Loading...