【问题标题】:Novell eDirectory with .NET DirectoryServices带有 .NET DirectoryServices 的 Novell eDirectory
【发布时间】:2012-07-25 05:10:21
【问题描述】:

在我们公司,我们有一个项目应该将 Novell eDirectory 与 .net 应用程序一起使用。 我已尝试使用 Novell Api (http://www.novell.com/coolsolutions/feature/11204.html) 在 .NET 应用程序之间进行连接。它工作正常。

但是,根据要求,我们特别需要 .net API 以不与 Novell Api 连接,这无法正常工作。与 .NET Api DirectoryServices 的连接和绑定不起作用。

我们的 Novell eDirectory 使用以下凭据安装:

  1. IP地址:10.0.x.xx(witsxxx.companyname.com)

  2. 树:SXXXX

  3. 新树上下文:WIxxxK01-NDS.OU=STATE.O=ORG

  4. ADMIN 上下文为:ou=STATE,o=ORG

  5. 管理员:管理员

  6. 密码:管理员

我使用了 Novell Api 并使用了以下代码

String ldapHost ="10.0.x.xx";
String loginDN = "cn=admin,cn=WIxxxK01-NDS,OU=STATE,o=ORG";
String password = string.Empty;
String searchBase = "o=ORG";
String searchFilter = "(objectclass=*)";
Novell.Directory.Ldap.LdapConnection lc = new Novell.Directory.Ldap.LdapConnection();

try
{
    // connect to the server
    lc.Connect(ldapHost, LdapPort);
    // bind to the server
    lc.Bind(LdapVersion, loginDN, password);
}

这样绑定正确,可以搜索了。

现在我的问题是当我尝试使用 .NET APi 和使用 System.DirectoryServicesSystem.DirectoryServices.Protocols,它没有连接或绑定。

我什至无法测试以下DirectoryEntry.Exists 方法。它会例外。

string myADSPath = "LDAP://10.0.x.xx:636/OU=STATE,O=ORG";

// Determine whether the given path is correct for the DirectoryEntry.
if (DirectoryEntry.Exists(myADSPath))
{
    Console.WriteLine("The path {0} is valid",myADSPath);
}
else
{
    Console.WriteLine("The path {0} is invalid",myADSPath);
}

上面写着Server is not operationalLocal error occurred 等。我不知道目录路径发生了什么。

我试过了

DirectoryEntry de = new DirectoryEntry("LDAP://10.0.x.xx:636/O=ORG,DC=witsxxx,DC=companyname,DC=com", "cn=admin,cn=WIxxxK01-NDS,o=ORG", "admin");
DirectorySearcher ds = new DirectorySearcher(de, "&(objectClass=user)");
var test = ds.FindAll();

一切都会例外。

你能帮我解决这个问题吗? DirectoryEntryuserDN 应该如何?

我也将System.DirectoryServices.Protocols.LdapConnectionLdapDirectoryIdentifierSystem.Net.NetworkCredential 一起使用,但没有结果。只有相同的例外。

感谢您宝贵的时间和帮助。

谢谢, 比努

【问题讨论】:

  • 据我记忆,我从来没有让它正常工作。 MSDN documentation on DirectoryEntry 还明确指出:DirectoryEntry 类封装了 Active Directory 域服务 层次结构中的节点或对象。 - System.DirectoryServices 真正面向 Active目录 - 它并不真正支持其他任何东西。所以要么继续使用本机 Novell API,要么你需要研究低级的原始 LDAP (S.DS.Protocols)
  • 也许this article on CodeProject可以作为起点——或者this post on social.msdn.com
  • 我也尝试了使用原始 LDAP (S.DS.Protocols) 的以下代码,但出现异常。尝试 { LdapDirectoryIdentifier lid = new LdapDirectoryIdentifier("10.0.x.xx",389); System.Net.NetworkCredential cred = new System.Net.NetworkCredential("cn=admin,cn=witsxxx-NDS,o=ORG", string.Empty);使用 (System.DirectoryServices.Protocols.LdapConnection lconn = new System.DirectoryServices.Protocols.LdapConnection(lid)) { lconn.Bind(cred); } }

标签: directoryservices novell


【解决方案1】:

要诊断您的 LDAP 连接错误,请从管理员那里访问 eDirectory 服务器,并使用 iMonitor(serverIP:8028/nds 并选择 Dstrace),在 Dstrace 中清除所有选项卡并启用 LDAP 跟踪,然后进行绑定看看什么发生在 LDAP 端,看看那里是否有更具描述性的错误。或者,如果您甚至可以绑定并建立连接。

【讨论】:

  • 我真希望我能理解这个答案的意思。我是只使用 Windows 的人,我被告知连接到 Novell 的 eDirectory 以验证当前登录 Windows PC 的用户是 Novell eDirectory 组“WeAreHarris”的成员。我什至不知道从哪里开始。
  • @jp2code 然后询问管理目录的人是否会启用 LDAP 跟踪,并在您尝试绑定时观察。他们可能需要选择一个副本进行测试,该副本具有最少的活动,因为很容易在正常事件的洪流中丢失您的测试。
  • 他们是客户。我们只能与销售代表交谈,他们无法为我们提供我们需要的有关其网络的信息。我们无法复制,因为我们是 Microsoft 商店,Novell 网络不会在这里运行……而且我们的 IT 团队没有任何人知道如何设置 Novell 所需的网络。
猜你喜欢
  • 2023-03-03
  • 2010-12-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多