本文介绍了组成员枚举限制...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 大家好,我正在尝试编写一个程序,该程序将在AD中找到所有组,并在与该组同名的文本文件中列出那里的用户.我可以列出所有7000个ish组,但是如果它是一个很大的组,则只会列出1500个成员.我玩过PageSize和SizeLimit TNA.我可以列出Powershell中的所有成员-所以我知道有超过1500个!下面的代码...有什么想法吗?(对不起,太厚了!)非常感谢,菲尔Hi Guys,I''m trying to write a program that will find all groups in AD and list there users in a text file of the same name as the group.I can list all 7000 ish groups, but if it is a large group it will only list 1500 members. I have played around with PageSize and SizeLimit TNA. I can list all members in Powershell - so I know there are more than 1500!code below...any ideas?(sorry for being thick!)Many Thanks,PhilDirectorySearcher ds = new DirectorySearcher();ds.Filter = "(objectClass=GROUP)";ds.PageSize = Int32.MaxValue;ds.SizeLimit = Int32.MaxValue;ds.SearchScope = SearchScope.Subtree;ds.PropertiesToLoad.Add("member");ds.PropertiesToLoad.Add("sAMAccountName");ds.Asynchronous = true;SearchResultCollection sr = ds.FindAll();foreach (SearchResult d in sr){string fName = d.GetDirectoryEntry).Properties["sAMAccountName"].Value.ToString() + ".txt";StreamWriter sw = new StreamWriter(fName);sw.AutoFlush = true;foreach (string i in d.GetDirectoryEntry().Properties["member"]){ sw.WriteLine(i);}推荐答案 这篇关于组成员枚举限制...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-31 15:12