I\'ve got a string that I\'m fetching from LDAP for Active Directory group membership and I need to parse it to check if the user is a member of the AD group. Is there a cl
Using System.DirectoryServices;
namespace GetGroups
{
public string GetGroupName(string LDAPGroupEntry)
{
// LDAPGroupEntry is in the form "LDAP://CN=Foo Group Name,DC=mydomain,DC=com"
DirectoryEntry grp = new DirectoryEntry(LDAPGroupEntry);
return grp.Properties["Name"].Value.ToString();
}
}