ADSOpenObject failed to bind with the DC

234 Views Asked by At

Im binding with the ldap server using ADSOpenObject method, with ADS_SECURE_AUTHENTICATION as binding option, but this binding request is failed with a message of hr = 0x8007200a. Why this request is failing.

int main() {

    IADs *pObject;
    HRESULT hr;

    hr = ADsOpenObject(L"LDAP://WIN-5PF8AFBE77P/DC=msdc,DC=xyz",
        L"administrator", 
        L"password",
        ADS_SECURE_AUTHENTICATION, 
        IID_IADs,
        (void**)&pObject);

    if(SUCCEEDED(hr))
    {
        cout<<"Success";
        pObject->Release();
    }
    else
    {
        cout<<"Unsuccessful";
        cout<<hr;
    }

}

Kindly, help me to fix this issue.

0

There are 0 best solutions below