gpt4 book ai didi

c# Active Directory 服务 findAll() 仅返回 1000 个条目

转载 作者:太空狗 更新时间:2023-10-29 22:03:47 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Can I get more than 1000 records from a DirectorySearcher in Asp.Net?

我正在使用 ADS 目录搜索器 findAll() 方法(如以下代码所示)搜索现有登录名。看起来 findall 方法只返回 1000 个条目,尽管条目比这更多。我如何找到每次登录的全部()?

    IList<string> adslist = new List<string>();
using (DirectoryEntry de = new DirectoryEntry("LDAP://armlink.com", null, null, AuthenticationTypes.Secure))
using (DirectorySearcher ds = new DirectorySearcher(de, "(objectclass=user)", new string[] { "samaccountname" }))

foreach (SearchResult sr in ds.FindAll())
{
string[] e = sr.Path.Split(new string[] { "LDAP://", "OU=", ",", "DC=", ".com", "/CN=" }, StringSplitOptions.RemoveEmptyEntries);
ResultPropertyCollection pc = sr.Properties;
adslist.Add(e[0] + "/" + pc["samaccountname"][0].ToString());
// Debug.WriteLine(adslist.Last());
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com