Microsoft KB Archive/834440

= The SetDynamicDNSRegistration method of the Win32_NetworkAdapterConfiguration WMI class does not work as expected in Windows XP =

Article ID: 834440

Article Last Modified on 8/13/2007

-

APPLIES TO


 * Microsoft Windows XP Professional
 * Microsoft Windows XP Home Edition

-





Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry



SYMPTOMS
In Microsoft Windows XP, the SetDynamicDNSRegistration method of the Win32_NetworkAdapterConfiguration Windows Management Instrumentation (WMI) class does not work as expected. For example, when you use the SetDynamicDNSRegistration method to configure settings for the dynamic registration of IP addresses by using DNS on the network adapter, the settings are not configured as expected.



CAUSE
This problem occurs because the SetDynamicDNSRegistration method does not modify the correct registry settings. In Windows XP, the DNS registration settings are stored in the RegistrationEnabled registry entry and in the RegisterAdapterName registry entry in the following registry key:

Instead of modifying these two registry entries, the SetDynamicDNSRegistration method creates two new registry entries, DisableDynamicUpdate and EnableAdapterDomainNameRegistration.



RESOLUTION
To resolve this problem, obtain the latest service pack for Windows XP. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

322389 How to obtain the latest Windows XP service pack



WORKAROUND
To work around this problem, use the following script to modify the registry and configure the DNS registration settings in Windows XP: 'On Error Resume Next

Const FULL_DNS_REGISTRATION =True Const DOMAIN_DNS_REGISTRATION = False

strComputer = &quot;.&quot; Set objWMILocator = CreateObject(&quot;WbemScripting.SWbemLocator&quot;) Set objWMICimService = objWMILocator.ConnectServer(strComputer, &quot;root\cimv2&quot;)

Set colOS = objWMICimService.ExecQuery(&quot;Select * from Win32_OperatingSystem&quot;)

For Each objOS in colOS

if ( InStr(1, objOS.Caption, &quot;XP&quot;, vbTextCompare) > 0 ) Then isWinXP = true else isWinXP = false End if

Next

Set colNetCards = objWMICimService.ExecQuery (&quot;Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True&quot;)

For Each objNetCard in colNetCards

if (isWinXP) Then retVal = SetAdapterInfoInRegistry(objNetCard.SettingID) Else retVal = objNetCard.SetDynamicDNSRegistration (FULL_DNS_REGISTRATION, DOMAIN_DNS_REGISTRATION) End if Next

if retVal <> 0 then Wscript.Echo &quot;Error Setting Dynamic DNS Registration.Error Number: &quot; & retVal Else Wscript.Echo &quot;Successfully Changed the required settings!&quot; End if Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and the tools that are used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, visit the following Microsoft Web site:

https://solutionfinder.microsoft.com/

For additional information about the support options available from Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;[LN;CNTACTMS]



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Windows XP Service Pack 2.



MORE INFORMATION
For more information about the SetDynamicDNSRegistration method of the Win32_NetworkAdapterConfiguration class, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/aa393298.aspx

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

890210 Windows XP client computers send FQDN DHCP option (81) request packets even if DNS dynamic update protocol registration is disabled globally

Keywords: kbnetwork kbfix kbbug KB834440

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.