views:

469

answers:

4

Cannot get the user list from ACtiveDirectory Services when accessed from another system in the same network.

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.

+1  A: 

Are you logging in correctly to the DirectoryEntry class?...

DirectoryEntry entry = new DirectoryEntry(path, domainAndUsername, password);
Chalkey
+1  A: 

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)";
Nikos Steiakakis
A: 

Here is an article at csharpcorner about listing user in AD using C#.

This one explains How To do (almost) anything with AD using C#.

TheVillageIdiot
A: 

You need to explain the scenario - how is your code deployed (I presume it is deployed as an asp.net webservice). If this is a web service then the most probable cause is the account under which asp.net runs doesnt have enough permissions.

MSIL