PC Review


Reply
Thread Tools Rate Thread

Access Active Directory from ASP.net 2.0 application

 
 
=?Utf-8?B?S2Fp?=
Guest
Posts: n/a
 
      1st Jun 2007
Hi all,

I need to access information from Active Directory from my ASP.net 2.0
application (vb.net). Therefore I made a DLL which retrieves the data from
Active Directory. This works fine, all tests successfull. But when I call
this DLL from my web application (currently installed on my local SQL Server)
I always get an error message:

"The specified domain either does not exist or could not be contacted."

I tested it with the same values in the DLL-Test and it works fine so it
seems to be a problem accessing the AD from IIS? The error is thrown in this
line:

"If Not (dirSearcher.FindOne() Is Nothing) Then"

Many thanks in advance!
Kai
 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      1st Jun 2007
"Kai" <(E-Mail Removed)> wrote in message
news:FF4BA752-5C94-40BB-8F8D-(E-Mail Removed)...

> I need to access information from Active Directory from my ASP.net 2.0
> application (vb.net). Therefore I made a DLL which retrieves the data from
> Active Directory. This works fine, all tests successfull. But when I call
> this DLL from my web application (currently installed on my local SQL
> Server)
> I always get an error message:
>
> "The specified domain either does not exist or could not be contacted."
>
> I tested it with the same values in the DLL-Test and it works fine so it
> seems to be a problem accessing the AD from IIS? The error is thrown in
> this
> line:
>
> "If Not (dirSearcher.FindOne() Is Nothing) Then"
>
> Many thanks in advance!


The default account which ASP.NET uses does not have permission to query
ActiveDirectory - you will need to impersonate a "standard" Domain User
account for this:
http://www.codeproject.com/useritems/everythingInAD.asp
http://support.microsoft.com/kb/317012
http://www.15seconds.com/issue/020730.htm
http://support.microsoft.com/kb/326340


--
http://www.markrae.net

 
Reply With Quote
 
=?Utf-8?B?S2Fp?=
Guest
Posts: n/a
 
      1st Jun 2007
Hi Mark,
thanks for your reply. I just set impersonation to 'true' in web.config and
it's running fine now... I wonder why there is a impersonation class on
CodeProject.... It sounds so difficult but was really easy now. But I guess I
should read this one at weekend as there are some information about possible
security problems ...

http://msdn2.microsoft.com/en-us/library/ms998351.aspx
 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      1st Jun 2007
"Kai" <(E-Mail Removed)> wrote in message
news:9429A765-427B-46E1-9559-(E-Mail Removed)...

> thanks for your reply. I just set impersonation to 'true' in web.config
> and
> it's running fine now...


Hurrah!

> I wonder why there is a impersonation class on CodeProject....


As an example of another way of doing things, I suppose - the .NET Framework
is so feature-rich that there is (almost) always more than one way of doing
anything...

> It sounds so difficult but was really easy now. But I guess I
> should read this one at weekend as there are some information about
> possible
> security problems ...
>
> http://msdn2.microsoft.com/en-us/library/ms998351.aspx


Also, you might like to have a look in microsoft.public.adsi.general -
anything that Joe Kaplan says, you can take as gospel... :-)


--
http://www.markrae.net

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to access Active Directory from web application? Hvid Hat Microsoft ASP .NET 1 17th Mar 2009 08:26 AM
Listing Active Directory groups that have directory access rights cwhankey@gmail.com Microsoft Excel Programming 0 17th Oct 2008 03:13 PM
AD/AM using Active Directory Application Mode in my application Dave Microsoft Windows 2000 Active Directory 3 5th Jan 2006 11:30 PM
Active Directory Application Access Managment =?Utf-8?B?REVXcmlnaHRfQ0FAb25saW5lLm5vc3BhbQ==?= Microsoft Dot NET 1 11th Oct 2005 09:10 PM
Web Application for Active Directory? Zean Smith Microsoft Dot NET Framework 1 22nd Jun 2005 07:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:02 PM.