473,395 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

asp.net and ldap

Hello,
I have a asp.net app working with directory services on my Windows XP
development machine. However when I moved the application over to our
production server (Win 2000 Server) it no longer works.

I use this code to try to connect to ldap:
System.DirectoryServices.DirectoryEntry entry = new
System.DirectoryServices.DirectoryEntry(LDAP://corp.mydomain.com,user,pass);

I tried using my user name and password, the domain admin user/pass but keep
on getting "the server is not operational" error. Now I know this is
security related, but after a day and a half of trying to get it to work and
searching google i cannot find out how to make it work!

I even tried using ldp.exe on the webserver, it worked fine. I was able to
connect right to the ldap no problem...

Any and alll help is greatly appreciated!!!

Thanks,

Bryan


Nov 19 '05 #1
5 2310
Hi Bryan,

Welcome to ASPNET newsgroup.
From your description, you have a certain asp.net web application which use
the System.DirectoryServices classes to make LDAP request to a remote
server. The application's ldap requery code works well on your development
machine, however you're encoutering "the server is not operational" error
when running a deployment server, yes?

AS for the LDAP query, are you accessing the ldap service through the SSL
port? If so , based on my experience, this should be a certificate related
issue. For SSL protected communication, when establishing the connection,
the clientside will validate the server certifiate in the local certificate
store, to find the Trusted root CA for that server certificate, if not
found , the connection establishing will fail. So if your ldap request is
really over SSL port, you can try checking your deployment server's
Computer Certificate Store's Trusted root CA to see whether you can find
the root CA for your ldap server's ssl server certificate. If you're not
quite sure on the root cert, you can checking the computer certificate
store on your development machine and compare them to see whether you can
find any clues.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bryan" <Br*****@nospam.nospam>
| Subject: asp.net and ldap
| Date: Wed, 7 Sep 2005 09:40:42 -0700
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#p*************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 208.46.205.150
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:122953
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello,
| I have a asp.net app working with directory services on my Windows XP
| development machine. However when I moved the application over to our
| production server (Win 2000 Server) it no longer works.
|
| I use this code to try to connect to ldap:
| System.DirectoryServices.DirectoryEntry entry = new
|
System.DirectoryServices.DirectoryEntry(LDAP://corp.mydomain.com,user,pass);
|
| I tried using my user name and password, the domain admin user/pass but
keep
| on getting "the server is not operational" error. Now I know this is
| security related, but after a day and a half of trying to get it to work
and
| searching google i cannot find out how to make it work!
|
| I even tried using ldp.exe on the webserver, it worked fine. I was able
to
| connect right to the ldap no problem...
|
| Any and alll help is greatly appreciated!!!
|
| Thanks,
|
| Bryan
|
|
|
|
|
|
|

Nov 19 '05 #2
Thanks for your response. However I got it to work. I had to change the web
site from IUSR to ASPNET and everything worked fine after that.
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGXA02.phx.gbl...
Hi Bryan,

Welcome to ASPNET newsgroup.
From your description, you have a certain asp.net web application which
use
the System.DirectoryServices classes to make LDAP request to a remote
server. The application's ldap requery code works well on your development
machine, however you're encoutering "the server is not operational" error
when running a deployment server, yes?

AS for the LDAP query, are you accessing the ldap service through the SSL
port? If so , based on my experience, this should be a certificate related
issue. For SSL protected communication, when establishing the connection,
the clientside will validate the server certifiate in the local
certificate
store, to find the Trusted root CA for that server certificate, if not
found , the connection establishing will fail. So if your ldap request is
really over SSL port, you can try checking your deployment server's
Computer Certificate Store's Trusted root CA to see whether you can find
the root CA for your ldap server's ssl server certificate. If you're not
quite sure on the root cert, you can checking the computer certificate
store on your development machine and compare them to see whether you can
find any clues.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bryan" <Br*****@nospam.nospam>
| Subject: asp.net and ldap
| Date: Wed, 7 Sep 2005 09:40:42 -0700
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <#p*************@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 208.46.205.150
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:122953
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hello,
| I have a asp.net app working with directory services on my Windows XP
| development machine. However when I moved the application over to our
| production server (Win 2000 Server) it no longer works.
|
| I use this code to try to connect to ldap:
| System.DirectoryServices.DirectoryEntry entry = new
|
System.DirectoryServices.DirectoryEntry(LDAP://corp.mydomain.com,user,pass);
|
| I tried using my user name and password, the domain admin user/pass but
keep
| on getting "the server is not operational" error. Now I know this is
| security related, but after a day and a half of trying to get it to work
and
| searching google i cannot find out how to make it work!
|
| I even tried using ldp.exe on the webserver, it worked fine. I was able
to
| connect right to the ldap no problem...
|
| Any and alll help is greatly appreciated!!!
|
| Thanks,
|
| Bryan
|
|
|
|
|
|
|

Nov 19 '05 #3
Thanks for your followup Bryan,

Glad that you've got the code work. As you mentioned that changing IUSR to
ASPNET worked, do you mean switch the ASP.NET application's process
identity from IUSR to ASPNET? If so, I think the problem is due to the IUSR
account didn't have the permission to access the computer store certificate
since it's a very restricted account.

Anyway, thanks again for your posting. Please always feel free to post here
when you need assistance.

Regards,

Steven Cheng
Microsoft Online Support

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


--------------------
| From: "Bryan" <Br*****@nospam.nospam>
| References: <#p*************@TK2MSFTNGP11.phx.gbl>
<#f**************@TK2MSFTNGXA02.phx.gbl>
| Subject: Re: asp.net and ldap
| Date: Thu, 8 Sep 2005 09:08:25 -0700
| Lines: 92
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| Message-ID: <ub**************@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 208.46.205.150
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP1
0.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:342649
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for your response. However I got it to work. I had to change the
web
| site from IUSR to ASPNET and everything worked fine after that.
|
|
| "Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
| news:%2****************@TK2MSFTNGXA02.phx.gbl...
| > Hi Bryan,
| >
| > Welcome to ASPNET newsgroup.
| > From your description, you have a certain asp.net web application which
| > use
| > the System.DirectoryServices classes to make LDAP request to a remote
| > server. The application's ldap requery code works well on your
development
| > machine, however you're encoutering "the server is not operational"
error
| > when running a deployment server, yes?
| >
| > AS for the LDAP query, are you accessing the ldap service through the
SSL
| > port? If so , based on my experience, this should be a certificate
related
| > issue. For SSL protected communication, when establishing the
connection,
| > the clientside will validate the server certifiate in the local
| > certificate
| > store, to find the Trusted root CA for that server certificate, if not
| > found , the connection establishing will fail. So if your ldap request
is
| > really over SSL port, you can try checking your deployment server's
| > Computer Certificate Store's Trusted root CA to see whether you can find
| > the root CA for your ldap server's ssl server certificate. If you're not
| > quite sure on the root cert, you can checking the computer certificate
| > store on your development machine and compare them to see whether you
can
| > find any clues.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | From: "Bryan" <Br*****@nospam.nospam>
| > | Subject: asp.net and ldap
| > | Date: Wed, 7 Sep 2005 09:40:42 -0700
| > | Lines: 28
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| > | X-RFC2646: Format=Flowed; Original
| > | Message-ID: <#p*************@TK2MSFTNGP11.phx.gbl>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: 208.46.205.150
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP11.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:122953
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | Hello,
| > | I have a asp.net app working with directory services on my Windows XP
| > | development machine. However when I moved the application over to our
| > | production server (Win 2000 Server) it no longer works.
| > |
| > | I use this code to try to connect to ldap:
| > | System.DirectoryServices.DirectoryEntry entry = new
| > |
| >
System.DirectoryServices.DirectoryEntry(LDAP://corp.mydomain.com,user,pass);
| > |
| > | I tried using my user name and password, the domain admin user/pass
but
| > keep
| > | on getting "the server is not operational" error. Now I know this is
| > | security related, but after a day and a half of trying to get it to
work
| > and
| > | searching google i cannot find out how to make it work!
| > |
| > | I even tried using ldp.exe on the webserver, it worked fine. I was
able
| > to
| > | connect right to the ldap no problem...
| > |
| > | Any and alll help is greatly appreciated!!!
| > |
| > | Thanks,
| > |
| > | Bryan
| > |
| > |
| > |
| > |
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #4
Ok, Now I have the same problem again with accessing active directory.
Because i started using "impersonate = true" in the web.config evertything
worked fine, because the user it was impersonating has permission to access
AD or is a user. That worked well and fine, until i wanted to give write
permissions to the aspnet account, so it could upload images to a folder.
So by turning off impersonate = true, made it so ASPNET was the user again
and had write permissions, but - AD was no longer accessable to the
application!!!!

HELP!
I need both to work!
I also tried explicitly putting the user name into this class -
System.DirectoryServices.DirectoryEntry entry = new
System.DirectoryServices.DirectoryEntry("LDAP://corp.companycom","company.com\myusername","mypassw ord");

and get the same error again stating that server is not operational!

What Shall I do???

Thanks,

Bryan

"Bryan" <Br*****@nospam.nospam> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hello,
I have a asp.net app working with directory services on my Windows XP
development machine. However when I moved the application over to our
production server (Win 2000 Server) it no longer works.

I use this code to try to connect to ldap:
System.DirectoryServices.DirectoryEntry entry = new
System.DirectoryServices.DirectoryEntry(LDAP://corp.mydomain.com,user,pass);

I tried using my user name and password, the domain admin user/pass but
keep on getting "the server is not operational" error. Now I know this is
security related, but after a day and a half of trying to get it to work
and searching google i cannot find out how to make it work!

I even tried using ldp.exe on the webserver, it worked fine. I was able to
connect right to the ldap no problem...

Any and alll help is greatly appreciated!!!

Thanks,

Bryan


Nov 19 '05 #5
Hi Bryan,

Since the problem occurs when you turn back to impersonate=false which
cause the default ASPNET account to run the asp.net application which
haven't sufficient permission to qurey the remote AD, then it is ok that
you still use impersonate and grant the impersonated user the access
permission to the folder you want to write?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bryan" <Br*****@nospam.nospam>
| References: <#p*************@TK2MSFTNGP11.phx.gbl>
| Subject: Re: asp.net and ldap
| Date: Thu, 15 Sep 2005 11:31:55 -0700
| Lines: 55
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| X-RFC2646: Format=Flowed; Response
| Message-ID: <up**************@TK2MSFTNGP09.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 208.46.205.150
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:124916
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Ok, Now I have the same problem again with accessing active directory.
| Because i started using "impersonate = true" in the web.config
evertything
| worked fine, because the user it was impersonating has permission to
access
| AD or is a user. That worked well and fine, until i wanted to give write
| permissions to the aspnet account, so it could upload images to a folder.
| So by turning off impersonate = true, made it so ASPNET was the user
again
| and had write permissions, but - AD was no longer accessable to the
| application!!!!
|
| HELP!
| I need both to work!
| I also tried explicitly putting the user name into this class -
| System.DirectoryServices.DirectoryEntry entry = new
|
System.DirectoryServices.DirectoryEntry("LDAP://corp.companycom","company.co
m\myusername","mypassword");
|
| and get the same error again stating that server is not operational!
|
| What Shall I do???
|
| Thanks,
|
| Bryan
|
| "Bryan" <Br*****@nospam.nospam> wrote in message
| news:%2***************@TK2MSFTNGP11.phx.gbl...
| > Hello,
| > I have a asp.net app working with directory services on my Windows XP
| > development machine. However when I moved the application over to our
| > production server (Win 2000 Server) it no longer works.
| >
| > I use this code to try to connect to ldap:
| > System.DirectoryServices.DirectoryEntry entry = new
| >
System.DirectoryServices.DirectoryEntry(LDAP://corp.mydomain.com,user,pass);
| >
| > I tried using my user name and password, the domain admin user/pass but
| > keep on getting "the server is not operational" error. Now I know this
is
| > security related, but after a day and a half of trying to get it to
work
| > and searching google i cannot find out how to make it work!
| >
| > I even tried using ldp.exe on the webserver, it worked fine. I was able
to
| > connect right to the ldap no problem...
| >
| > Any and alll help is greatly appreciated!!!
| >
| > Thanks,
| >
| > Bryan
| >
| >
| >
| >
| >
| >
|
|
|

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: dmcconkey | last post by:
Hi folks, I've been searching for a while and haven't found my specific question anywhere else. If this has already been asked, please accept my appologies and point me to the appropriate...
7
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or...
1
by: Angel | last post by:
Hello all - I have a LDAP service running on a NT4 box (not a mbr of my AD domain), I'd like to extract the users/attributes from that LDAP service and populate my AD domain with those users and...
4
by: m96 | last post by:
hi, i'm trying to make a query to a ldap server (version v2 or v3 doen't matter) with c#. the query works just fine but the problem is that i can't read the custom attributes/fields, since .net...
4
by: Terry Miller | last post by:
I have DB2 V8.2 loaded on a Redhat Enterprise Linux version 3 (RHEL 3) box. RHEL is configured to talk to LDAP for authenticaton besides the local passwd file. I can verify this by executing an su...
2
by: duncan beaumont | last post by:
Hi, - SQLserver 2000 - Yellowfin 2.4 - Windows 2003 server I have been asked to investigate seting up LDAP authentication to access our Yellowfin reporting.
5
by: Jed Parsons | last post by:
Hi, authenticates a user against our ldap server.: User types in name and password, and module sees if name and password check out right with the ldap server. I see that it's pretty...
3
by: sallas | last post by:
Hi, I have a simple LDAPS script: #!/usr/bin/python2.3 import sys import ldap if __name__ == '__main__': ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
0
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
0
by: Sells, Fred | last post by:
I'm running python 2.5 (or 2.4) in an XP environment. I downloaded and installed the .dll's from OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in c:/windows/system32 as instructed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.