By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

Access Active Directory from ASP.net 2.0 application

P: n/a
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
Jun 1 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Kai" <Ka*@discussions.microsoft.comwrote in message
news:FF**********************************@microsof t.com...
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

Jun 1 '07 #2

P: n/a
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
Jun 1 '07 #3

P: n/a
"Kai" <Ka*@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.com...
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

Jun 1 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.