using Novell.Directory.Ldap.Utilclass;
public static void Main()
const string DistinguishedName = "CN=r1,OU=DN1";
Dn dn = new Dn(DistinguishedName);
string commonName = dn.RdNs.FirstOrDefault(x => x.Type == "CN")?.Value;
Console.WriteLine("DN: {0}, CN: {1}", DistinguishedName, commonName);