Describing the ADSI Path
The Lightweight Directory Access Protocol (LDAP) requires that you escape some characters with a backslash (\) character when you use them in an LDAP Active Directory Service Interfaces (ADSI) path.
,=+<>#;\"
The escape character is only required for the ADSIPath property value.
The following example shows how to define the ADSIPath property. Note that the # character in the CN property value of abc# is escaped.
// #include <windows.h> for this code to compile
BSTR strObjPath =
SysAllocString(L"ds_user.ADSIPath=\"LDAP://CN=abc\#,"
L"CN=Users,DC=dsprovider,DC=nttest,"
L"DC=microsoft,DC=com\"");
// Use strObjectPath here.
SysFreeString(strObjPath); // Free memory resources.
Note
For more information about support and installation of this component on a specific operating system, see Operating System Availability of WMI Components.