Article ID: 834440 - Last Review: August 13, 2007 - Revision: 6.3

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

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  (http://support.microsoft.com/kb/256986/ ) Description of the Microsoft Windows Registry
Expand all | Collapse all

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:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<NetworkAdapterGUID>
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  (http://support.microsoft.com/kb/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 = "."
Set objWMILocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMICimService = objWMILocator.ConnectServer(strComputer, "root\cimv2")

Set colOS = objWMICimService.ExecQuery("Select * from Win32_OperatingSystem")

For Each objOS in colOS

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

Next

Set colNetCards = objWMICimService.ExecQuery  ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

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 "Error Setting Dynamic DNS Registration.Error Number: "  & retVal
Else
	Wscript.Echo "Successfully Changed the required settings!"
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 and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools 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 needs.
If you have limited programming experience, you may want to contact a Microsoft Certified Partner or Microsoft Advisory Services. For more information, visit these Microsoft Web sites:

Microsoft Certified Partners - https://partner.microsoft.com/global/30000104 (https://partner.microsoft.com/global/30000104)

Microsoft Advisory Services - http://support.microsoft.com/gp/advisoryservice (http://support.microsoft.com/gp/advisoryservice)

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS (http://support.microsoft.com/default.aspx?scid=fh;en-us;cntactms)

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" 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 (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  (http://support.microsoft.com/kb/890210/ ) Windows XP client computers send FQDN DHCP option (81) request packets even if DNS dynamic update protocol registration is disabled globally

APPLIES TO
  • Microsoft Windows XP Professional
  • Microsoft Windows XP Home Edition
Keywords: 
kbnetwork kbfix kbbug KB834440
 

Article Translations

 

Related Support Centers