How to get distinguishname for OpenLDAP sever

杀马特。学长 韩版系。学妹 提交于 2019-12-25 03:37:49

问题


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!


回答1:


I'm not sure I follow what you mean by the "distinguishedName of an Active Directory server"... What is you're actually trying to accomplish?

Your current code will essentially bind to what's called RootDSE on the local domain controller.



来源:https://stackoverflow.com/questions/11122947/how-to-get-distinguishname-for-openldap-sever

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!