aumatically settings DNS IP addresses on client

  • Thread starter Thread starter parhez Sattar
  • Start date Start date
P

parhez Sattar

Is there a way to add additional DNS server IP addresses
to Win2K clients, in an NT domain environment? We are
preparing for our upgrade to W2K3 AD domain and need to
make each of the clients aware of the DNS servers that
will point them to the DCs. Thanks in advance.
 
Sorry to have failed to mention that "DHCP"
and "Forwarding from the existing Unix DNS Server" are not
options for me. I am looking for more of a
remote/scripted/GP solutions.
 
strIPaddr=Array("XXX,xXX,XXX,XXX")
strSNMask=Array("XXX,xXX,XXX,XXX")
strGateway=Array("XXX,xXX,XXX,XXX")
strPWINS="XXX,xXX,XXX,XXX"
strSWINS="XXX,xXX,XXX,XXX"
strPDNS= "XXX,xXX,XXX,XXX"
strSDNS= "XXX,xXX,XXX,XXX"
strDNSServer=Array(strPDNS, strSDNS)

Set objService=GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objEnumerator=objService.ExecQuery("Select * From
Win32_NetworkAdapterConfiguration Where DatabasePath IS NOT NULL")

objService.Security_.impersonationlevel = 3

For Each objInstance in objEnumerator
intStatus=objInstance.SetWINSServer (strPWINS, strSWINS)
intStatus=objInstance.SetDNSServerSearchOrder(strDNSServer)
intStatus=objInstance.EnableStatic (strIPaddr, strSNMask)
intStatus=objInstance.SetGateways(strGateway)
Next
 
Back
Top