Re: Windows Server Bug?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Script is below. Exact steps are ran the script, confirmed that the new
settings were showing in the GUI for network interfaces, but when testing
found that the new suffix search order list was not active. Checked and
found that a GPO was also setting the search order and that setting was
taking effect and was shown in the registry and in ipconfig but not in the
network interface configuration GUI.


'Runs on a local machine as part of the imaging process to disable DNS
auto-registration for interfaces with
'a 192.168.x.x address. Also checks for interfaces in the 10.8.3 and 10.8.7
subnets and if found, assigns the primary
'and secondar DNS servers in the IP configuration . The DNS suffix search
order is set for all adapters.

Dim strComputer
Dim strIPAddress, arrIPAddress
Dim strPrimaryDNS, strSecondaryDNS, arrDNSServers, arrDNSSuffix
Dim strDomainSuffix1, strDomainSuffix2, strDomainSuffix3, strDomainSuffix4,
strDomainSuffix5
Dim strDomainSuffix6, strDomainSuffix7, strDomainSuffix8

On Error Resume Next

strPrimaryDNS = "10.8.3.10"
strSecondaryDNS = "10.8.3.11"
strDomainSuffix1 = "suffix1.com"
strDomainSuffix2 = "suffix2.com"
strDomainSuffix3 = "suffix3.com"
strDomainSuffix4 = "suffix4.com"
strDomainSuffix5 = "suffix5.com"
strDomainSuffix6 = "suffix6.net"
strDomainSuffix7 = "suffix7.net"
strDomainSuffix8 = "suffix8.com"

arrDNSServers = Array(strPrimaryDNS,strSecondaryDNS)
arrDNSSuffix = Array(strDomainSuffix1, strDomainSuffix2, strDomainSuffix3, _
strDomainSuffix4, strDomainSuffix5, strDomainSuffix6, strDomainSuffix7,
strDomainSuffix8)
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objAdapter in colAdapters
If Not IsNull(objAdapter.IPAddress) Then
For i = 0 to UBound(objAdapter.IPAddress)
strIPAddress = objAdapter.IPAddress(i)
Next
End If
arrIPAddress = Split(strIPAddress,".",4,1)
If arrIPAddress(0) = "192" And arrIPAddress(1) = "168" Then
if objAdapter.DomainDNSRegistrationEnabled = True Or
objAdapter.FullDNSRegistrationEnabled = True Then
objAdapter.SetDynamicDNSRegistration False, False
End If
End If
If arrIPAddress(0) = "10" And arrIPAddress(1) = "8" and arrIPAddress(2) =
"3" Then
objAdapter.SetDNSServerSearchOrder(arrDNSServers)
End If
If arrIPAddress(0) = "10" And arrIPAddress(1) = "8" and arrIPAddress(2) =
"7" Then
objAdapter.SetDNSServerSearchOrder(arrDNSServers)
End If
Next
Set objNetworkSettings =
objWMIService.Get("Win32_NetworkAdapterConfiguration")
objNetworkSettings.SetDNSSuffixSearchOrder(arrDNSSuffix)


"Jorge Silva" <jorgesilva_pt@xxxxxxxxxxx> wrote in message
news:eeWclgJAIHA.4656@xxxxxxxxxxxxxxxxxxxxxxx
I'm not a script master but can you post here ythe script and describe the
exact steps that you did?


--
I hope that the information above helps you.
Have a Nice day.

Jorge Silva
MCSE, MVP Directory Services
"dveit" <darrin_veit@xxxxxxxxxxxxxx> wrote in message
news:ubadRcIAIHA.5980@xxxxxxxxxxxxxxxxxxxxxxx
Correct, the information show via ipconfig and populate via GPO is in the
registry. However, what is shown in the GUI and populated in WMI is not
located in the registry.

"Jorge Silva" <jorgesilva_pt@xxxxxxxxxxx> wrote in message
news:%23H6foRIAIHA.5980@xxxxxxxxxxxxxxxxxxxxxxx
Hi
As far as I know that info isregistered in:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\SearchList

--
I hope that the information above helps you.
Have a Nice day.

Jorge Silva
MCSE, MVP Directory Services
"dveit" <darrin_veit@xxxxxxxxxxxxxx> wrote in message
news:OZPyyqGAIHA.4324@xxxxxxxxxxxxxxxxxxxxxxx
Ran into an issue where writing a WMI script to change the DNS server
list and DNS suffix search order on a given interface runs successfully
and the results are shown in the Local Area Network Configuration GUI
for a given interface. However, there was a GPO that was setting the
DNS servers and DNS suffix search order as well and this setting was
shown in ipconfig and the registry (and utlimately was the setting that
was taking effect). So my question is: where does WMI write DNS server
and suffix search order information to and where does the Local Area
Network Configuration GUI pull information from since the registry
value was not changed by the WMI script?









.



Relevant Pages

  • Re: Ease of use (was: Re: Idiot (I know thats redundant) spammer
    ... 'Longhorn' GUI, and while by then there clearly *was* an existing interface ... If you want to talk about editing, the more apt comparison is between ... TECO was wonderful: I ...
    (comp.os.vms)
  • Re: Denigration of GUI
    ... For myself designing the interface is the most challenging and interesting ... I think a Java GUI can create a screen that acts just ... data bound controls are an option but I use them rarely. ... that CLI screens are reusable in a way ...
    (comp.lang.cobol)
  • Re: Confusing stack effects
    ... so a Click&Go interface is nonsensical. ... somewhat more difficult to do with half a dozen self contained GUI ... What does Annie have to ... Or even assemblers? ...
    (alt.lang.asm)
  • Re: GUI vs: CLI (was: Shell command in VB6)
    ... >Parsing switches isn't much trouble. ... >> interface to the program and then write a GUI wrapper around it? ... the command line is the command line. ...
    (comp.programming)