Binds to an ADSI object using the given credentials, retrieving an IDispatch pointer on the specified object.
HRESULT IADsOpenDSObject::OpenDSObject(
BSTR bstrDNName, //ADsPath of the object to bind to
BSTR bstrUserName, //User Name to be used
BSTR bstrPassword, //Password to be used
long lnReserved, //Binding options
IDispatch ** ppADSIObj //Interface on an ADSI object
);
FLAG | Value |
---|---|
ADSI_USE_SECURE_AUTHENTICATION | 0x00000001 |
ADSI_USE_ENCRYPTION | 0x00000010 |
See Notes to Implementers below.
This method supports the standard return values E_FAIL and E_UNEXPECTED, as well as the following:
To use default credentials, set bstrUserName and bstrPassword to NULL.
The behavior of OpenDSObject when lnFlags is set is provider-specific. Namespaces that require high security may ignore these flags and always require authentication. For provider-specific details, see Microsoft Platform SDK ADSI reference section.
Windows NT: Use version 4.0 Service Pack 2 and later.
Windows CE: Unsupported.
Header: Declared in iads.h.
ADSI Namespace Object, IADsOpenDSObject