Compartilhar via


Active Directory Provider

The Active Directory provider, also known as the Directory Services (DS) provider, maps Active Directory objects to WMI. By accessing the LDAP namespace in WMI, you can reference or alias any object in the Active Directory.

As a dynamic instance and class provider, the Active Directory provider supports the standard IWbemProviderInit interface, as well as the following methods of the IWbemServices interface:

The Active Directory provider supports limited querying for association objects. For more information, see Accessing Active Directory.

To update the properties of a Directory Services provider instance, you must provide an IWbemContext object or a SWbemNamedValueSet object (for scripting) with these values defined:

  • "__PUT_EXT_PROPERTIES"

    A string array that contains the name of the properties you want to update.

  • "__PUT_EXTENSIONS"

    A boolean value set to true.

  • "__PUT_EXT_CLIENT_REQUEST"

    A boolean value set to true.

The following VBScript code gives an example of how to provide a SWbemNamedValueSet object with the correct values defined to update the properties of a Directory Services provider.

set svc = GetObject("Winmgmts:root\directory\ldap")
set octx = createobject("wbemscripting.swbemnamedvalueset")

octx.add "__PUT_EXT_PROPERTIES", array("ds_displayname")
octx.add "__PUT_EXTENSIONS", true
octx.add "__PUT_EXT_CLIENT_REQUEST", true

set objEnum = svc.execQuery("select * from ds_computer", "WQL", 32)

for each obj in objEnum
 obj.put_ 1, octx
next

WMI Providers

IWbemContext

IWbemContext::SetValue method

SWbemNamedValueSet

SWbemNamedValueSet.Add method