首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >LDAP无效凭据- Active 2012 R2

LDAP无效凭据- Active 2012 R2
EN

Stack Overflow用户
提问于 2018-11-22 17:20:04
回答 1查看 1K关注 0票数 0

我以前没有使用过Active Directory,我需要在C#中的统一独立实现和通过LDAP安装在Windows 2012 R2上的Active之间建立连接。每次连接时,我都会得到相同的错误:

LdapException:(49)无效凭据LdapException:服务器消息: 8009030C: LdapErr: DSID-0C0903C5,注释: AcceptSecurityContext错误,数据2030,v2580

我确信我的用户名和密码是正确的。

代码语言:javascript
运行
复制
DirectoryEntry entry = new DirectoryEntry("LDAP://"+ serverName+":"+port,userName,password);

    DirectorySearcher ds = new DirectorySearcher(entry);

    ds.Filter = "XX";

    SearchResult result = ds.FindOne();
    ResultPropertyCollection rpc = result.Properties;
    foreach (string property in rpc.PropertyNames)
    {
        foreach (object value in rpc[property])
            console.text+="Property = " + property + "Value = " + value;
    }
}
catch (Exception ex)
{
    Debug.Log(ex);
}

我已经尝试过使用LdapAdmin (开放源码LDAP目录管理工具),但是即使在windows PowerShell中的ldp命令行中,我也收到了同样的错误。任何帮助都将不胜感激。屏幕截图

EN

回答 1

Stack Overflow用户

发布于 2018-11-23 12:59:50

这是模糊的,但你被拒绝的原因是错误信息。真正的错误是data字段的值。在这种情况下,错误是0x2030

将值转换为十进制以获得8240

然后查找错误。在FormatMessage API将给您提供或命令行上,您可以:

代码语言:javascript
运行
复制
net helpmsg 8240

你就会得到

代码语言:javascript
运行
复制
There is no such object on the server.

这意味着您正在使用的用户名不存在,有一个错误,等等。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53435749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档