Problem while accessing Active Directory

M

Maqsood Ahmed

Hello,

Environment Details:

Development:
VS 2005 Team System
SQL Server 2005
Windows XP

Production:
Windows Server 2003 (Web Server)
Windows Server 2003 (Active Directory Server)

I am facing problems while getting All users from the Active Directory,
using System.DirectoryServices namespace.

I am trying get all the users in the AD from my web application (I want
to display all the users). It works fine at the development terminal
(because the user is logged on to AD), but when I deploy the application
and try to access the list of users from there, following exception is
being thrown.

System.Runtime.InteropServices.COMException (0x80072020): An operations
error occurred.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean
findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindAll()

I have also found out that the current user is an authenticated AD user.
Please also note that the IIS server is not the AD server.

Any suggestions please. Thanks in advance.

Maqsood Ahmed - MCAD.net
Kolachi Advanced Technologies
http://www.kolachi.net
 
J

Joe Kaplan

It sounds like you are trying to impersonate the authenticated user and use
their credentials to access AD. If you want to do this using integrated
windows auth in IIS, you'll need to enable Kerberos delegation. There are
many articles and newsgroup posts that document how to do this.

If you don't want to use impersonation, then you can configure the process
account with an account that can access AD. If you are using 2003 web
server and the server is a domain member, then the network service account
(which is the default app pool identity) will use the machine account
credentials when accessing the network and should already have the necessary
rights to bind to AD and execute queries.

Joe K.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top