I know to get the distinguish name for Active directory server:
DirectoryEntry nRoot = new DirectoryEntry("LDAP://localhost:389");//this for OpenLDAP
string dnPath = nRoot.Properties["distinguishedName"].Value.ToString();
I am getting an error that 'An invalid dn syntax has been specified'
though if try the same code with AD server IP instead of localhost:389 it runs perfectly.
Any idea?
Thanks!