Home All Groups Group Topic Archive Search About


Author
9 Aug 2005 1:58 PM
Bert
Hi all,

I am creating a logon script in vbs.
I want it to delete the hostfile, and then copy one from a share like the
NETLOGON.
Anyone who can give me an idea how I should do this?

Thx

Author
10 Aug 2005 2:15 AM
Marty List
"Bert" <B***@discussions.microsoft.com> wrote in message
news:C60918E8-EA5F-46C8-8BA9-DFC9CB1EAA7A@microsoft.com...
> Hi all,
>
> I am creating a logon script in vbs.
> I want it to delete the hostfile, and then copy one from a share like the
> NETLOGON.
> Anyone who can give me an idea how I should do this?
>
> Thx


The logon scripts will run as the user logs on, with the user's security
context.  Unless all your user accounts are in the local Administrators
group (or they have permissions to delete the hosts file) this won't work.

If you use a computer startup script in Group Policy, then the script will
run before any users log on and will run as the local system (similar to
Administrator permissions).  I haven't done this exactly, but I think it
would work as long as the share containing the hosts file allowed access to
all computer accounts in your domain.

Before you spend a lot of time on a script, just test out the concept with a
simple one-line batch script like this:

XCopy "\\MyServer\MyShare\hosts" "%WINDIR%\System32\Drivers\etc\hosts" /r /y

Make sure you test on different machines with differnet user accounts
(non-admins).

PS - Are you sure you can't use DNS instead of managing all these local
files?

AddThis Social Bookmark Button