简体   繁体   English

从ActiveDirectory获取用户时遇到问题[ASP.NET中的C#]

[英]Problem getting Users from ActiveDirectory [C# in ASP.NET]

Cannot get the user list from ACtiveDirectory Services when accessed from another system in the same network. 从同一网络中的另一个系统访问时,无法从ACtiveDirectory Services获取用户列表。

If accessed from where the code is, then we can obtain the userlist, but cannot get it when accessed from other system in the same network. 如果从代码所在的位置进行访问,那么我们可以获得用户列表,但是当从同一网络中的其他系统访问时,则无法获得该用户列表。 Any help is utmost appreciated... 非常感谢您的任何帮助...

Thanks, Venkat. 谢谢,文卡特。

Your problem maybe a "double hop" related issue. 您的问题可能是与“双跳”相关的问题。 The identity of the calling user cannot be passed on further than the server where the code is. 主叫用户的身份不能传递到代码所在的服务器之外。 One solution is to Bind the call to a user 一种解决方案是将呼叫绑定到用户

    DirectoryEntry dEntry = new DirectoryEntry("LDAP://path", "uname", "password");
    DirectorySearcher dsSearch = new DirectorySearcher(dEntry);
    dsSearch.Filter = "(objectCategory=user)";

您是否正确登录到DirectoryEntry类?...

DirectoryEntry entry = new DirectoryEntry(path, domainAndUsername, password);

Here is an article at csharpcorner about listing user in AD using C#. 这是csharpcorner上的一篇有关使用C#在AD中列出用户的文章。

This one explains How To do (almost) anything with AD using C#. 这篇解释了如何使用C#使用AD进行(几乎)任何操作。

You need to explain the scenario - how is your code deployed (I presume it is deployed as an asp.net webservice). 您需要解释这种情况-您的代码是如何部署的(我假设它是作为asp.net Web服务部署的)。 If this is a web service then the most probable cause is the account under which asp.net runs doesnt have enough permissions. 如果这是Web服务,则最可能的原因是运行asp.net的帐户没有足够的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM