Settings DNS in WinPe

  • Thread starter Thread starter pseegars
  • Start date Start date
P

pseegars

I'm trying to do some testing in our RnD domain with a WinPE based
deployment. Problem is that the default DNS dished out by DHCP is for
my production domain, so it keeps failing when trying to find RnD
resources (DP, MP, etc) How can I set the DNS server used by WinPE?

Paul Seegars
SMS-MOM-Group Policy
 
If using WinPE 2005 you can set DNS using the following script (does
not work in WinPE 2004):

Sample script: setdns.vbs

On Error Resume Next

strComputer = "."
strDNSHostName = "client1"
strDNSDomain = "tslab.net"
arrDNSServerSearchOrder = Array("192.168.16.2", "192.168.16.3")
arrDNSDomainSuffixSearchOrder = Array("tslab.net")

Set objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer
& "\root\cimv2")
Set objNicConf =
objWMIService.Get("Win32_NetworkAdapterConfiguration")

intEnableDNS = objNicConf.EnableDNS(strDNSHostName, strDNSDomain,
arrDNSServerSearchOrder, arrDNSDomainSuffixSearchOrder)

Note: some lines may have been wrapped by the newsreader


regards

Johan Arwidmark
Microsoft MVP - Setup/Deployment
 
Followup, you can of course also use the hosts file in WinPE for
testing...


regards

Johan Arwidmark
Microsoft MVP - Setup/Deployment
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top