2009-10-26 60 views
0

我有LDAP的一個問題,我使用Apache目錄服務器,我想補充一個新的用戶.... 我使用Visual Studio和代碼片段:LDAP錯誤:目錄服務不可用

public static void prova(string FullName) 
{   
    DirectoryEntry container; 
    DirectoryEntries ChildEntry; 

    container = new DirectoryEntry("LDAP://localhost:10389/cn=user1,ou=users,ou=system", "admin", "secret"); 

    try 
    { 
     ChildEntry = container.Children; 
     DirectoryEntry NewEntry = ChildEntry.Add("cn=" + FullName, "user"); 
     NewEntry.CommitChanges(); 
     NewEntry.Close(); 
    } 
    catch (Exception ex) 
    { 
     throw new Exception("Error " + ex.Message); 
    } 
} 

的問題是,我有這種類型的錯誤:

The directory service is not available

有人能幫助我嗎?

回答

1

是否可以遠程連接到服務器或使用LDAP瀏覽器如LdapExplorerTool連接: http://ldaptool.sourceforge.net/

遠程登錄本地主機10389

如果這是不可能的服務器沒有響應,並顯示您檢查您的LDAP服務器。

我認爲主要的LDAP端口是389,可能值得一試。

0

這很可能是您的管理員的綁定dn不足。

您應該爲您的LDAP用戶提供完整的LDAP樣式DN。

像:CN =管理員,OU =用戶,OU =系統

(似乎是不可能的根大部分對象是類的OU,(你OU =系統部件),但可能大多數LDAP實現我處理。不要使用這個特定的約定,而是將它們根植在一個O =或DC =中,如果允許的話,我認爲它取決於特定的模式)。

相關問題