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