我需要使用 .NET Core 创建一个在 Linux 上运行的 LDAP 客户端。我在互联网上搜索,唯一支持 .Net 标准的库是 Novell.Directory.Ldap (开源,iei - https://github.com/dsbenghe/Novell.Directory.Ldap.NETStandard)。目录服务库在 Linux 的 .Net Core 中不支持,仅在 Windows 上支持。
我查看了文档并成功创建了一个基本的 Ldap 客户端应用程序。
现在的问题是:我需要同步很多用户(10.000、200.000 个用户),默认情况下我的 ldap 服务器的最大大小页面为 1000(我不想更改它)。我使用 VirtualListControl 来创建页面,它对于 10k 用户来说工作正常。
对于 20 万用户,它会崩溃并显示错误 53 - 不愿意执行LdapSortControl 响应。Novell 库需要 LdapSortControl 才能执行分页操作(用于索引),我认为我的 ldap 无法排序 200k。我使用的代码:
int startIndex = 1;
int contentCount = 0;
int afterIndex = 10;
int count = 0;
do
{
LdapVirtualListControl ctrl = new LdapVirtualListControl(startIndex, 0, afterIndex, contentCount);
LdapSortKey[] keys = new LdapSortKey[1]; …Run Code Online (Sandbox Code Playgroud)