問題描述
當我嘗試根據角色從 AD 獲取所有用戶時出現異常:
When trying to get all users from AD based on a role I was getting the exception:
System.DirectoryServices.Protocols.DirectoryOperationException:超出大小限制
System.DirectoryServices.Protocols.DirectoryOperationException: The size limit was exceeded
在此線程的幫助下:LdapConnection SearchRequest 拋出異常超出大小限制 我嘗試實現分頁.
With help of this thread : LdapConnection SearchRequest throws exception for "The size limit was exceeded I tried implementing paging.
現在出現異常:
服務器不支持控件.控制至關重要.
The server does not support the control. The control is critical.
關于如何解決它的任何想法?我得到一個較小的基于角色的用戶列表,無需分頁.謝謝.
Any ideas on how to go about resolving it? I get a smaller list of role based users fine without paging. Thanks.
更新:我在這里找到了檢查 AD 是否支持分頁的代碼 iPlanet LDAP 和 C# PageResultRequestControl 我得到了支持分頁的結果.
UPDATE: I found code to check if paging is supported by AD here iPlanet LDAP and C# PageResultRequestControl and I got the result that paging is supported.
推薦答案
針對帖子發布的解決方案 分頁 LDap 搜索因請求的屬性不存在"而失敗 也幫助我解決了我的問題.我正在使用 AuthType.Basic 并將其更改為 AuthType.Ntlm 使分頁代碼運行良好.我懷疑它會影響我擁有的任何其他 AD 代碼,但如果我發現任何需要注意的地方,我會檢查并發布.
The solution posted in response to thread Paged LDap search fails with "The requested attribute does not exists" helped me with my issue too. I was using AuthType.Basic and changing it to AuthType.Ntlm had the paging code running fine. I doubt it will affect any other piece of AD code that I have but I'll check and post if I find anything to watch out for.
謝謝.
這篇關于如何解決“服務器不支持控件.控制至關重要."活動目錄錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!