Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
Add Comment
Please, Sign In to add comment