active directory and asp.net error.

J

Jamie

I'm getting the following error exception when using the code below.

I've seen a number of people post the same problem. Many of the solutions
say to use impersonate=true in web.config, or update machine.config to
specify the username and password in the processmodel element, or to use
delegation, but they've all said you don't need to do those things if you
specify a username and password in the DirectoryEntry constructor... which
is what i'm doing.

This works fine on my local webserver, but as soon as i publish it to
another webserver it throws an exception. Does anybody have any other
suggestions? By the way, i'm using Visual Studio .NET 2003.

thanks.

Unknown error (0x80005000)
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.PropertyValueCollection.PopulateList()
at System.DirectoryServices.PropertyCollection.get_Item(String propertyName)


-------------

DirectoryEntry root = new DirectoryEntry(LDAP://my_domain,
"my_domain\\some_domain_user", "password");
DirectorySearcher searcher = new DirectorySearcher(root);
searcher.Filter = "(&(objectClass=user)(sAMAccountName=some_domain_user))";
SearchResult searchResult = searcher.FindOne();
DirectoryEntry entry = searchResult.GetDirectoryEntry();
object o = entry.Properties["givenname"].Value; // exeception occurs here
/>
 
M

MSFT

Hi Jamie,

I have replied same question in microsoft.public.dotnet.aspnet.security,
please refer to that thread.

Thanks,


Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top