Microsoft KB Archive/329207

= IWMIExtension::GetWMIOBject method will not be supported on .Net server versions of the LDAP ADSI provider. =

Article ID: 329207

Article Last Modified on 3/19/2004

-

APPLIES TO


 * Microsoft Windows XP Professional
 * Microsoft Active Directory Service Interfaces 2.5

-



This article was previously published under Q329207



SUMMARY
The purpose of this article is to clarify the Microsoft position on the IWMIExtension implementation that exists in pre .Net versions of the LDAP provider. These versions include, Windows XP, all versions of Windows 2000 and those version of Windows NT that have the Directory Services Client for Windows NT Workstation installed.



MORE INFORMATION
The IWMIExtension is no longer considered a supported method for accessing the Win32_ComputerSystem object via the LDAP provider. The afore mentioned versions of the windows operating systems do provide access to this object via the LDAP provider by binding to a computer object and using the GetWMIObject method, however, using the LDAP provider to access the WMI object is not recommended and will not be supported.

The supported method for accessing the Win32_ComputerSystem object for a given computer system is to build the WMI provider string and create the object directly. This can be done in two lines of VBS code. The Following VBS code snippet illustrates how one can bind to a computer object in the AD and then build the WMI Win32_ComputerSystem path string:

dim oComp ' ' Get the computer object set oComp = GetObject(&quot;LDAP://cn=myComputer,ou=domain controllers,dc=home,dc=com&quot;) ' ' Dimension the WMI object ' dim oWMI ' ' Build the WMI path from the CN of the computer object as follows: ' wmiPath = &quot;WINMGMTS:{impersonationLevel=impersonate}!//&quot;&oComp.Get(&quot;cn&quot;)&&quot;/root/cimv2:Win32_ComputerSystem.Name=&quot; &chr(34)& oComp.Get(&quot;cn&quot;) & chr(34) WScript.Echo wmiPath set oWMI= GetObject( wmiPath ) WScript.echo oWMI.UserName Wscript.echo &quot;Done&quot;

In future releases of the LDAP provider the Win32_ComputerSystem object will not be available. The programmer will be responsible for building the Win32_ComputerSystem string and create the WMI object.

The MSDN documentation will is being updated to reflect this change.

