Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Adding a host file via group policy

3,760 views
Skip to first unread message

Marcin

unread,
Feb 23, 2008, 7:47:56 AM2/23/08
to
You can incorporate a command copying it from a central location into the
computer startup script...

hth
Marcin

Florian Frommherz [MVP]

unread,
Feb 23, 2008, 8:45:41 AM2/23/08
to
Howdie!

Haroon Malik schrieb:
> 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

unread,
Feb 24, 2008, 5:08:00 AM2/24/08
to
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


"Haroon Malik" wrote:

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

> Regards,
> --
> Haroon Malik
>
> Systems Engineer

Florian Frommherz [MVP]

unread,
Feb 24, 2008, 6:01:33 AM2/24/08
to
Howdie!

Haroon Malik schrieb:


> 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.

Haroon Malik

unread,
Feb 24, 2008, 7:22:00 AM2/24/08
to
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.

Mukunthan Seshadri

unread,
Aug 2, 2010, 6:48:38 PM8/2/10
to
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 Malik


"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 Malik

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 the
computer startup script...

hth
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 sample
script.

Regards,
--
Haroon Malik

Systems Engineer


"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\hosts

cheers,

Florian
--
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 it
work. I am doing it as a user logon script.

Please help


--
Haroon Malik


"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,

Florian
--
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 Malik


"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

0 new messages