#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    0

    LDAP fails when trying to connect with Remote PC


    Hi all,



    I am currently having problems with LDAP when I try to access it from a remote computer. When I try to connect in the local computer however, it works properly.



    Here is my setup:



    Server I want to access: FQDN: sccmdc.sccm.com (It is an Active Directory, Win Server 2008 x64)

    Client I use: FQDN: client (not part of the domain, Win Server 2008 x86)



    Firewalls are both off



    Essentially, this is my code:





    IADs *pObject;
    HRESULT hr; // Initialize COM.
    CoInitialize(NULL);
    hr =ADsGetObject(L"LDAP://sccmdc/DC=sccm,DC=com", IID_IADs, (void**) &pObject);

    cout << "NOO" << endl;

    if(SUCCEEDED(hr))
    {
    // Use the object.
    cout << "YEHEY" << endl; // Release the object. pObject->Release(); } // Uninitialize COM.

    CoUninitialize();

    IADs *pObject;

    HRESULT hr;



    // Initialize COM.

    CoInitialize(NULL);



    hr = ADsGetObject(L"LDAP://sccmdc/DC=sccm,DC=com",

    IID_IADs,

    (void**) &pObject);



    cout << "NOO" << endl;



    if(SUCCEEDED(hr))

    {

    // Use the object.

    cout << "YEHEY" << endl;

    // Release the object.

    pObject->Release();

    }



    // Uninitialize COM.

    CoUninitialize();



    When I run it in the local computer itself (sccmdc), I get both "NOO" and "YEHEY". When I try to run it in the client, I don't get the "YEHEY".



    Any ideas what I'm doing wrong? Is my LDAP string wrong? Do I need to configure other things?



    Thank you!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2010
    Posts
    2
    Rep Power
    0
    Hi all,



    Just an update, I found out what the error code is returned when I try to access it. It returns: 0x8007052E. Which means bad username / password.



    I'm quite confused by this since the username / password I am submitting is correct. I tried with the NAA account and the Administrator account, but both fails.



    I even tried adding the client computers to the domain and they still don't work.



    Now I tried doing something, and the weird part is it works.





    In the Server I try to access, there is an account named "Administrator" with password "P@ssw0rd123456".



    What I did was create a similar account in one of the client computers ("Administrator" with password "P@ssw0rd123456") and tried doing the same thing only instead of supplying explicit Username and Password, I tried to access it using only current credentials.


    And it works!!



    I'm not really sure what I am doing wrong. Can you please tell me if my the parameters I pass is correct?



    LDAP String: "LDAP://sccmdc/DC=sccm,DC=com"

    Username: "sccm\lean.alcabasa"

    Password: "P@ssw0rd"



    Thank you!

IMN logo majestic logo threadwatch logo seochat tools logo