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
If you don't want to add additional dependencies and just want to parse the string..
This type of string can easily be parsed just using string.Split. To get the CN values, would be something like..
string[] split = "CN=Foo Group Name,DC=mydomain,DC=com".Split(',');
List cnValues = new List();
foreach(string pair in split){
string[] keyValue=pair.Split('=');
if(keyValue[0]=="CN")
cnValues.Add(keyValue[1]);
}