Set DNS Servers Via Script
I would like to use a batch file or some kind of script to temporarily change the DNS servers on a number of Vista and XP clients for a disaster recovery exercise. The machines will all be DHCP clients so I would need to be able to change them back to DHCP assigned as well. The script could be run manually by the users themselves since they all have admin rights, most likely.This could easily be done by using netsh if there was only one NIC per workstation and if it was always named "Local Area Connection". Since that is not the case, I need something that will change it globally on each workstation. I haven't seen any command that will do that. Any ideas for this?Thanks.
February 26th, 2010 7:29am

Hi, Thank you for posting here. Regarding your question, I would like to share the following with you for your reference: Scripting DNS on Clients Need a script to change TCP/IP DNS settings parameters Since this question is related to writing a script, it is recommended that you go to Scripting Forum for help: Scripting Forum Hope this helps. Thanks. Nicholas Li TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com.Nicholas Li - MSFT
Free Windows Admin Tool Kit Click here and download it now
February 26th, 2010 2:04pm

Thanks much. I found a script in that Technet link and I tested it successfully. It will replace both dhcp-assigned DNS servers with one static DNS server. In a different section of the same page, I found one that sets the client back to DHCP. I will test that out as well. If that works I am finished.Cheers.
February 27th, 2010 7:24am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics