C# 如何获取OpenLDAP服务器的名称
我知道如何获取Active directory服务器的区分名称:C# 如何获取OpenLDAP服务器的名称,c#,.net,windows,active-directory,openldap,C#,.net,Windows,Active Directory,Openldap,我知道如何获取Active directory服务器的区分名称: DirectoryEntry nRoot = new DirectoryEntry("LDAP://localhost:389");//this for OpenLDAP string dnPath = nRoot.Properties["distinguishedName"].Value.ToString(); 我收到一个错误“指定了无效的dn语法” 虽然如果用AD服务器IP而不是localhost:389尝试相同的代码,
DirectoryEntry nRoot = new DirectoryEntry("LDAP://localhost:389");//this for OpenLDAP
string dnPath = nRoot.Properties["distinguishedName"].Value.ToString();
我收到一个错误“指定了无效的dn语法”
虽然如果用AD服务器IP而不是localhost:389尝试相同的代码,它运行得非常好
有什么想法吗
谢谢 我不确定我是否理解您所说的“Active Directory服务器的可识别名称”。。。你到底想做什么 您当前的代码实际上将绑定到本地域控制器上的RootDSE