我以前没有使用过Active Directory,我需要在C#中的统一独立实现和通过LDAP安装在Windows 2012 R2上的Active之间建立连接。每次连接时,我都会得到相同的错误:
LdapException:(49)无效凭据LdapException:服务器消息: 8009030C: LdapErr: DSID-0C0903C5,注释: AcceptSecurityContext错误,数据2030,v2580
我确信我的用户名和密码是正确的。
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命令行中,我也收到了同样的错误。任何帮助都将不胜感激。屏幕截图
发布于 2018-11-23 12:59:50
这是模糊的,但你被拒绝的原因是错误信息。真正的错误是data字段的值。在这种情况下,错误是0x2030。
将值转换为十进制以获得8240。
然后查找错误。在FormatMessage API将给您提供或命令行上,您可以:
net helpmsg 8240你就会得到
There is no such object on the server.这意味着您正在使用的用户名不存在,有一个错误,等等。
https://stackoverflow.com/questions/53435749
复制相似问题