I need a way to see if a user is part of an active directory group from my .Net 3.5 asp.net c# application.
I am using the standard ldap authentication example off o
This seems much simpler:
public bool IsInRole(string groupname) { var myIdentity = WindowsIdentity.GetCurrent(); if (myIdentity == null) return false; var myPrincipal = new WindowsPrincipal(myIdentity); var result = myPrincipal.IsInRole(groupname); return result; }