Scan the network and identify a directory service

Last post 11-05-2009 12:30 AM by kamlesh_g_k. 0 replies.

Sort Posts:

  • Scan the network and identify a directory service

    11-05-2009, 12:30 AM
    • Member
      point Member
    • kamlesh_g_k
    • Member since 11-05-2009, 12:14 AM
    • Posts 3

    Hi LDAP gurus!
       We have a requirement to scan the network and identify a directory service.
    I'm using the C++ library WinLDAP.h from Microsoft
    (http://msdn.microsoft.com/en-us/library/aa367016(VS.85).aspx)
    to search for a directory service....this is the code that initially gets the - 'rootDSE'
    HRESULT hr;
    CComVariant vartest, var, var1;
    hr = ADsGetObject( L"LDAP://rootDSE",IID_IADs,(void**)  
                                                                       &pObject ); if ( !SUCCEEDED(hr) )
    {
        return -1;    
    }
    hr = pObject-Get(CComBSTR(L"defaultNamingContext"),&var);
    if ( !SUCCEEDED(hr) )
    {
        return -1;    
    }
    I have 3 questions
    a) Is this code good enuf to actually ensure that 
        the network has a directory service?
    b) We are querying Active directory, but we should be able to   
        look for directory services like IBM trivoli, etc too.
    c) How do we identify if the directory service found is Ms Active Directory or IBM tivoli etc
    Any response would be appreciated.

    Hi LDAP gurus!

    We have a requirement to scan the network and identify a directory service.
    I'm using the C++ library WinLDAP.h from Microsoft
    (http://msdn.microsoft.com/en-us/library/aa367016(VS.85).aspx)

    to search for a directory service....this is the code that initially gets the - 'rootDSE'


    HRESULT hr;
    CComVariant vartest, var, var1;

    hr = ADsGetObject( L"LDAP://rootDSE",IID_IADs,(void**)  

                                                                       &pObject );

    if ( !SUCCEEDED(hr) ){

        return -1;    
    }


    hr = pObject-Get(CComBSTR(L"defaultNamingContext"),&var);

    if ( !SUCCEEDED(hr) )

    {

        return -1;    

    }


    I have 3 questions

    a) Is this code good enuf to actually ensure that the network has a directory service?

    b) We are querying Active directory, but we should be able to  look for directory services like IBM trivoli, etc too.

    c) How do we identify if the directory service found is Ms Active Directory or IBM tivoli etc


    Any response would be appreciated.


Page 1 of 1 (1 items)