无法连接到LDAP服务器 [英] NOT Able to connect to LDAP Server
本文介绍了无法连接到LDAP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PrincipalContext ctx = new PrincipalContext(ContextType.ApplicationDirectory, "domain.com", "ou=*Garden City Users, o=microsoft,c=us", ContextOptions.SecureSocketLayer | ContextOptions.SimpleBind, "CN=ppatel, OU=*Garden City Users, O=Microsoft, C=US ", "password");
UserPrincipal up = UserPrincipal.FindByIdentity(ctx, IdentityType.Name,"ppatel");
if (up != null)
{
PrincipalSearchResult<Principal> Results = up.GetAuthorizationGroups();
foreach (Principal Result in Results)
{
Response.Write(Result.Name);
}
}
我正在尝试获取与用户相关联的所有组.我的代码在上面.当我尝试运行它时,出现错误消息 LDAP服务器不可用....
谁能帮忙这个
谢谢
PPatel
I am trying to get all the group to which user is associated. My code is above. when i am trying to run it i am getting error that LDAP SERVER IS UNAVAILABLE ....
Can anyone please help on this
Thanks
PPatel
推荐答案
在这里,您有一个完整的解决方案来查找具有.net的AD支持的那些组( ^ ]),而不是LDAP:http://stackoverflow.com/questions/5309988/how-to-get-用户在活动目录中的组-c-asp-net [
Here you have a complete solution to find those groups with .net''s AD support (http://msdn.microsoft.com/en-us/magazine/cc135979.aspx[^]), not with LDAP: http://stackoverflow.com/questions/5309988/how-to-get-the-groups-of-a-user-in-active-directory-c-asp-net[^]
这篇关于无法连接到LDAP服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文