LDAP服务器不可用(Active Directory)

编程入门 行业动态 更新时间:2024-10-25 09:34:07
本文介绍了LDAP服务器不可用(Active Directory)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

尝试从Active Directory获取信息并将其显示在文本框中。 从localhost运行它确实有效但当我将它托管到服务器并运行它时,它会给我这个错误LDAP服务器不可用 这是我的代码

m trying to take information from the Active Directory and display it to text box. When am running it from localhost it does work but when i host it to a server and run it, it give me this error "LDAP server is unavailable" Here is my code

Session["name"] = txtnameuser2nd.Text; PrincipalContext context = new PrincipalContext(ContextType.Domain, "NMMU"); UserPrincipal user = UserPrincipal.FindByIdentity(context, Session["name"].ToString()); txtname2nd.Text = user.GivenName.ToString(); txtlastname2nd.Text = user.Surname.ToString();

推荐答案

我终于找到了解决方案。 I finally found the solution. Session["name"] = txtnameuser2nd.Text; PrincipalContext context = new PrincipalContext(ContextType.Domain, "nmmu.ac.za"); UserPrincipal user = UserPrincipal.FindByIdentity(context, Session["name"].ToString()); txtname2nd.Text = user.GivenName.ToString(); txtlastname2nd.Text = user.Surname.ToString();

i ddnt为用户提供对域服务器的完全访问权限,所以我通过包含域服务器的正确名称解决了它。 nmmu.ac.za而不是nmmu。 nmmu没有完全定义 : - )

i ddnt give the user full access to the domain server, so i solved it by including the correct name of the domain server. nmmu.ac.za instead of nmmu. nmmu was not fully defined :-)

看起来更多的人有同样的问题,可能是链接 [ ^ ]可以帮助你。 It looks like more people had the same problem, probably one of the links[^] can help you.

看起来更多的人有同样的问题,可能一of 链接 [ ^ ]可以帮助您。 It looks like more people had the same problem, probably one of the links[^] can help you.

更多推荐

LDAP服务器不可用(Active Directory)

本文发布于:2023-11-17 02:56:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608552.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不可用   服务器   LDAP   Active   Directory

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!