PC Review


Reply
Thread Tools Rate Thread

DirectorySearcher.FindOne() failure on W2K3....

 
 
=?Utf-8?B?TWljaGFlbFk=?=
Guest
Posts: n/a
 
      6th Jul 2004
An odd problem, but here goes:

We implemented an ASMX web service as a gateway to the University's OpenLDAP directory to provide basic gorup membership / attribute lookups based on UID using the System.DirectoryServices namespace. Problem is that on a W2k3 box (member of AD), DirectorySearcher.FindOne() fails with a "Object reference not set to an instance..." error, with the stack dump pointing to the "IADsContainer::GetObject" method. On Win XP SP1, SP RC2, Win2k Server, Win2k Adv Server, and Win 2k Workstation (all members of the same AD), this works fine - but NOT on 2k3...tried both ConsoleMode (even running as Admin - yuck!!) app and WebPage / Service.

After verifying that firewalls were not causing our problem(s), I wrote a simple Win32 DLL using the LDAP API directly (with the same criteria) to query the OpenLDAP server, and (as expected) it works flawlessly. I can, however, simulate the same problem with the LDAP API by attempting ANY sort of binding operation against the OpenLDAP server...the code stalls for a few moments, then bombs out, failing on the bind attempt (the OpenLDAP directory provided by the University is set up for anonymous read-only querying ONLY - skipping the binding allows the queries to run successfully).

Question is: Are there any known changes / updates on server 2k3 (I assume a security and/or ADSI change) would cause this to operation to fail?? I have no problem using my Win32 DLL, but I would rather use the built-in supported namespaces instead.

TAI,
MichaelY
 
Reply With Quote
 
 
 
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      6th Jul 2004
>We implemented an ASMX web service as a gateway to the University's OpenLDAP directory
>to provide basic gorup membership / attribute lookups based on UID using the System.DirectoryServices namespace.
>Problem is that on a W2k3 box (member of AD), DirectorySearcher.FindOne() fails with a "Object reference not set to an instance..." error,


That kinda sounds like a permissions problem - especially in ASP.NET
apps, permissions and bind credentials are crucial.

Since I'm not myself an ASP.NET expert, I'd strongly recommend you
check out the microsoft.public.adsi.general newsgroup, or the Yahoo
group "ADSIandDirectoryServices" (groups.yahoo.com - search for that
name).

So of the folks there are experts on ASP.NET permissioning and stuff
like that - they should be able to point to in the right direction.

Just out of curiosity - FindOne() is known to have some issues, e.g.
memory leaks. Does .FindAll() work???

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Reply With Quote
 
=?Utf-8?B?TWljaGFlbFk=?=
Guest
Posts: n/a
 
      8th Jul 2004
Marc,

Tried the FindAll() method instead - same results (even while running as a console application, logged in as administrator)....any other ideas????

Also, since I did not provide exact error details last time, here is the stack dump from either search attempt:

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object.
at System.DirectoryServices.Interop.IDirectorySearch.GetColumn(IntPtr hSearch
Result, IntPtr szColumnName, IntPtr pSearchColumn)
at System.DirectoryServices.ResultsEnumerator.GetCurrentResult()
at System.DirectoryServices.ResultsEnumerator.get_Current()
at System.DirectoryServices.ResultsEnumerator.System.Collections.IEnumerator.
get_Current()
at System.DirectoryServices.SearchResultCollection.get_InnerList()
at System.DirectoryServices.SearchResultCollection.get_Count()
at ConsoleDriver.TestApp.Main()....

TIA,
MichaelY

"Marc Scheuner [MVP ADSI]" wrote:

> >We implemented an ASMX web service as a gateway to the University's OpenLDAP directory
> >to provide basic gorup membership / attribute lookups based on UID using the System.DirectoryServices namespace.
> >Problem is that on a W2k3 box (member of AD), DirectorySearcher.FindOne() fails with a "Object reference not set to an instance..." error,

>
> That kinda sounds like a permissions problem - especially in ASP.NET
> apps, permissions and bind credentials are crucial.
>
> Since I'm not myself an ASP.NET expert, I'd strongly recommend you
> check out the microsoft.public.adsi.general newsgroup, or the Yahoo
> group "ADSIandDirectoryServices" (groups.yahoo.com - search for that
> name).
>
> So of the folks there are experts on ASP.NET permissioning and stuff
> like that - they should be able to point to in the right direction.
>
> Just out of curiosity - FindOne() is known to have some issues, e.g.
> memory leaks. Does .FindAll() work???
>
> Marc
>
> ================================================================
> Marc Scheuner May The Source Be With You!
> Bern, Switzerland m.scheuner(at)inova.ch
>

 
Reply With Quote
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      8th Jul 2004
>Tried the FindAll() method instead - same results (even while running as a console application, logged in as administrator)....any other ideas????

Okay, thanks.

>Also, since I did not provide exact error details last time, here is the stack dump from either search attempt:
>
>Unhandled Exception: System.NullReferenceException: Object reference not set to
>an instance of an object.
> at System.DirectoryServices.Interop.IDirectorySearch.GetColumn(IntPtr hSearch
>Result, IntPtr szColumnName, IntPtr pSearchColumn)


That failure would indicate it can't find the column it's looking
for.... hm..... is there any chance you might be asking for a column
that's either present in OpenLDAP but not AD, or vice versa?

Marc
 
Reply With Quote
 
=?Utf-8?B?TWljaGFlbFk=?=
Guest
Posts: n/a
 
      8th Jul 2004
>
> That failure would indicate it can't find the column it's looking
> for.... hm..... is there any chance you might be asking for a column
> that's either present in OpenLDAP but not AD, or vice versa?
>

Absolutely - the property we're looking for only exists in the OpenLdap realm, and does not exist in our local AD, although I'm hoping this isn't a problem with ADSI - we really don't care about and/or want that property in our local AD - it's a property specific to students only (entities that we don't have in our local AD anyway).

Perhaps a little background - due to 'edu' politics, our local AD is only our division (about 500-750 people). The OpenLDAP directory (University-wide) is ALL students, faculty, staff, etc (about 65,000 +)...you get the point. The service we are providing is an attribute lookup on student entities to see if they meet certain criteria. So, essentially, we just want to query to OpenLdap server, read the results (which the Win32 LDAP API does nicely, without binding), and continue with the appropriate business logic from there.

Perhaps the ADSI API's (and consequently System.DirectoryServices) are trying to do something with the local domain controllers during binding that is now restricted on W2k3???

Thanx again,
MichaelY
 
Reply With Quote
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      9th Jul 2004
Hi Michael,

>Perhaps the ADSI API's (and consequently System.DirectoryServices) are trying to do something
>with the local domain controllers during binding that is now restricted on W2k3???


I can't think of anything that would cause this kind of problem.
Hmm..... not sure if anyone else has ever seen this......

You might want to repost your question to a more appropriate
newsgroup, such as

* microsoft.public.adsi.general
* microsoft.public.platformsdk.adsi
* microsoft.public.server.active_directory

There's a ton of very qualified and helpful AD experts hanging out
there..... (and not necessarily here).

MArc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Reply With Quote
 
=?Utf-8?B?TWljaGFlbFk=?=
Guest
Posts: n/a
 
      9th Jul 2004
Marc,

I'll go ahead and post the same questions in those grouops - thanx so much for your help / time - it is greatly appereciated!!!

MichaelY
 
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
Exception at DirectorySearcher.FindOne Carsten Witte Microsoft C# .NET 1 11th Jul 2009 03:14 PM
DirectoryEntry FindOne local SAM Brian Stoop Microsoft C# .NET 1 26th May 2008 06:00 AM
DirectorySearcher.FindOne() fails when LDAP path contains "/" =?Utf-8?B?bWJheWhh?= Microsoft Dot NET Framework 2 24th Mar 2005 03:02 PM
Exception thrown using DirectorySearcher.FindOne() =?Utf-8?B?bWJheWhh?= Microsoft Dot NET Framework 0 21st Mar 2005 11:51 PM
W2K3 RAS Routing Failure with routing error code 57 SMC Microsoft Windows 2000 RAS Routing 0 20th Dec 2003 09:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:19 PM.