3
我需要能够获得团体用户在列表,但我需要有一个/一些/所有的以下特性可见:如何在Asp.Net中为用户获取AD用户组?
- 的distinguishedName
- 名
- CN 。
- SAM帐户
我现在所拥有的返回有些名气的,但不是任何上述的那些(名字似乎接近,但无法正确所有比赛的这是我使用:
ArrayList groups = new ArrayList();
foreach (System.Security.Principal.IdentityReference group in System.Web.HttpContext.Current.Request.LogonUserIdentity.Groups)
groups.Add(group.Translate(typeof(System.Security.Principal.NTAccount)));
就像我说的,上述工作,但不会得到我需要我的程序(上面指定的)的专有名称。我需要这是能够与列表中我得到的,同时呼吁所有的团体在我的域名匹配:
DirectoryEntry dirEnt = new DirectoryEntry("LDAP://my_domain_controller");
DirectorySearcher srch = new DirectorySearcher(dirEnt);
srch.Filter = "(objectClass=Group)";
var results = srch.FindAll();
我刚刚注意到结果的返回列表限制为1000.我的域中有超过1000个组(HUGE域)。我怎样才能获得超过1000条记录?我可以从稍后的记录开始吗?我可以将它切成多个搜索吗? – naspinski 2008-09-18 07:07:30