簡體   English   中英

針對LDS的C#LDAP

[英]C# LDAP against LDS


我正在嘗試解決此問題,但無法使其正常工作。
問題

我的查詢出了什么問題?

編碼

private static void ExecuteQuery()
        {
            string sDomain = "10.12.14.165:389";
            string sDefaultOU = "CN=GeneralUsers,CN=Company,DC=Server,DC=LDS,DC=LOCAL";
            string sServiceUser = "myUser";
            string sServicePassword = "myPassword";


            DirectoryEntry ldapEntry = new DirectoryEntry("LDAP://" + sDomain + @"/" + sDefaultOU,
                                                          sServiceUser,
                                                          sServicePassword);

            DirectorySearcher ldapSearcher = new DirectorySearcher(ldapEntry);
            //Error Occurs here
            SearchResultCollection ldapResult = ldapSearcher.FindAll();
        }

錯誤

@ SearchResultCollection ldapResult = ldapSearcher.FindAll();
例外:服務器上沒有這樣的對象。

注意

對象確實存在

LDS配置中發生了問題。 我進行身份驗證的用戶無權使用LDS,我使用的查詢工作正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM