how can I use netsh to remotely set and add multiple DNS server addresses

Tech-Archive recommends: Fix windows errors by optimizing your registry



Can someone help me with how to use netsh to set and add multiple DNS
server addresses to remote PCs that are running Windows XP and Windows
98.

I have created a batch file (.bat) with the following entries:

netsh interface ip set dns name="Local Area Connection" static
192.168.1.1
netsh interface ip add dns name="Local Area Connection" 192.168.1.230

This works fine, changes the DNS entries on the local PC when logged in
as the Administrator. How can I make this work when a standard USER is
logged in?

My preference would be to take input from a .txt file with many IP
addresses (pcs.txt) and run the "netsh interface ip add dns" command
within a .bat in order to update the DNS entries.

This is what I have used before to run other commands on remote systms.
"for /f %%i in (pcs.txt) do uptime \\%%i >> uptimes1.csv"

So I tried to place the line below in a .bat
"for /f %%i in (pcs.txt) do netsh interface ip set dns name="Local Area
Connection" static 192.168.1.1 \\%%i"

This yielded ERROR------> \\192.168.1.110 is not an acceptable value
for register

I realize I can do this with a GPO which would include a Startup
script, but these systems are not part of a AD Domain.

Can someone help please?
Thanks in advance for your help - Jorge

.



Relevant Pages

  • Setting Alternate DNS server with NETSH command ???
    ... I can't see a way to use NETSH to set the alternate DNS server ... netsh interface ip set dns "Local Area Connection" static 192.168.1.1" ...
    (microsoft.public.win2000.networking)
  • Re: Modifying IP address by modifying the registry programatically
    ... Check your settings (although I doubt that dynamic DNS is setup in your ... will the name-to-address mapping change when you change the IP address. ... This change takes place on the DNS server, not on the host itself. ... > I have certain doubts with regard to the "netsh" command. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Changing Primary and Secondary DNS servers in IP Properties
    ... I played with the netsh command ... and was able to change the primary DNS and add a secondary DNS. ... sets the source for configuring DNS servers to local static ... Changing Primary and Secondary DNS servers in IP Properties ...
    (microsoft.public.windows.server.migration)
  • RE: Changing Primary and Secondary DNS servers in IP Properties
    ... I played with the netsh command and was ... able to change the primary DNS and add a secondary DNS. ... configuring DNS servers to local static configuration. ...
    (microsoft.public.windows.server.migration)
  • Cannot join new domain
    ... I am currently setting up a domain running Windows Server 2003 SP2 and am ... following information can help you troubleshoot your DNS configuration. ... Ethernet adapter Wireless Network Connection: ... Connection-specific DNS Suffix. ...
    (microsoft.public.windows.server.dns)