In Active Directory, bind to an object using username and password credentials.
HRESULT ADsOpenObject(
LPWSTR lpszPathName, //The ADsPath name of the object
LPWSTR lpszUserName, //User name to use for credentials
LPWSTR lpszPassword, //Password to use for credentials
DWORD dwReserved, //Provider-specific flags
REFIID riid, //IID of primary interface
VOID FAR * FAR *ppObject //Interface on that object
);
This method supports the standard return values E_FAIL and E_UNEXPECTED, as well as the following:
The ADsOpenObject helper function is called by the C/C++ client to bind to an Active Directory object using the username and password as credentials for the appropriate directory service. This function is the code equivalent of calling the IADsOpenDSObject::OpenDsObject method.
Windows NT: Use version 4.0 and later.
Windows CE: Unsupported.
ADSI Namespace Object, IADsOpenDSObject