Ok, I'm not sure if this thing's haunted or what, but just FYI to this thread... I 
went to show a coleague the problem I was having and it was gone. The only change I 
had made was to seperate my AD access methods into their own class and assigning the 
the value to a public string variable in that class. Which seemingly wouldn't make any 
difference. I can now retrieve the department field using the exact same syntax. Go 
Figure...

<>< Ryan

-----Original Message-----
From: Robert Chartier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 07, 2002 4:24 PM
To: dotnet
Subject: RE: C# - System.DirectoryServices - Searching



my experiences with System.DirectoryServices lead up to the 
conclusion......  dont use it.

its a very poor COM interop hack job.

create whatever you need in vb or other, and then do your own com interop


Scorecard:

8637 types FOR framework

60 types AGAINST framework
         (All types within System.DirectoryServices)




At 04:07 PM 8/7/2002 -0600, you wrote:
>Well this figures...
>
>[NotImplementedException: Handling of this ADSVALUE type is not yet 
>implemented (type = 0xb).]
>    System.DirectoryServices.ResultPropertyValueCollection.get_Item(Int32 
> index) +111
>    myFile.Page_Load(Object sender, EventArgs e) in myFile.aspx.cs:46
>    System.Web.UI.Control.OnLoad(EventArgs e) +67
>    System.Web.UI.Control.LoadRecursive() +29
>    System.Web.UI.Page.ProcessRequestMain() +724
>
>... I do care about the department value. So what does this mean, I sit 
>around and wait until Microsoft Supports it? Geesh... it's kind of ironic 
>that PHP, written by a bunch of linux people, can pull the value fine, but 
>.NET DirectoryServices, a Microsoft Developement, cannot?
>
>Anyway, I found reference to this that mentions a way to make it work.... 
>one word... kludge.
>
>Hopefully this is a helpful thread to someone. Even if it is a monologue.
>
><>< Ryan
>
>
>
>
>-----Original Message-----
>From: Ryan Jameson (USA)
>Sent: Wednesday, August 07, 2002 3:18 PM
>To: dotnet
>Subject: RE: C# - System.DirectoryServices - Searching
>
>
>Finally, I figured out that the problem occurs at this point, after the 
>actual search is a sucess:
>
>//  retVal = retVal + "\n" + resEnt.GetDirectoryEntry().Name.ToString();
>retVal = retVal + "\n" + resEnt.GetDirectoryEntry().Path.ToString();
>//retVal = retVal + "\n" + resEnt.GetDirectoryEntry().NativeGuid.ToString();
>
>
>If I uncomment either of the two lines above I will get the error below. 
>No matter though, I have my object now and I don't care about the Name or 
>Guid... thankfully.
>
><>< Ryan
>
>
>-----Original Message-----
>From: Ryan Jameson (USA)
>Sent: Wednesday, August 07, 2002 2:45 PM
>To: dotnet
>Subject: RE: C# - System.DirectoryServices - Searching
>
>
>FYI....
>
>The continued saga: (The majority of documentation seems to say the 
>following is the correct way)...
>
>DirectoryEntry entry = new 
>DirectoryEntry("LDAP://myADServer/CN=Users,DC=myOrg,DC=org";);
>System.DirectoryServices.DirectorySearcher mySearcher = new
>System.DirectoryServices.DirectorySearcher(entry);
>
>mySearcher.Filter = ("(samaccountname=rjameson)");
>
>
>Kaboom! ----
>
>[COMException (0x80005000): Unknown error (0x80005000)]
>    System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +514
>    System.DirectoryServices.DirectoryEntry.Bind() +10
>    System.DirectoryServices.DirectoryEntry.get_AdsObject() +10
>    System.DirectoryServices.DirectorySearcher.FindAll(Boolean 
> findMoreThanOne) +199
>    System.DirectoryServices.DirectorySearcher.FindAll() +10
>    webAppsDotNet.adServices.directorySearch() in 
> c:\webdev\webappsdotnet\directoryservices.cs:28
>    webAppsDotNet.doTheWork.Page_Load(Object sender, EventArgs e) in 
> c:\webdev\webappsdotnet\dothework.aspx.cs:35
>    System.Web.UI.Control.OnLoad(EventArgs e) +67
>    System.Web.UI.Control.LoadRecursive() +29
>    System.Web.UI.Page.ProcessRequestMain() +724
>
>
>My LDAP lookups work great in PHP. I'm honestly trying to unbiasedly 
>decide if .NET can serve us better. After almost 3 hours  and finding 
>nothing more than an "Unknown error" when it took me about 20 minutes to 
>completely implement extracting user data from the active directory in 
>PHP... I really want to see this work!
>
>
>
>-----Original Message-----
>From: Ryan Jameson (USA)
>Sent: Wednesday, August 07, 2002 1:57 PM
>To: dotnet
>Subject: C# - System.DirectoryServices - Searching
>
>
>Can someone tell me why doesn't the code below find the object who's 
>samaccountname property = rjameson?
>It works fine with this: mySearcher.Filter = ("(objectClass=*)");
>
>-----------------------------
>
>DirectoryEntry entry = new DirectoryEntry("LDAP://myADServer";);
>System.DirectoryServices.DirectorySearcher mySearcher = new
>System.DirectoryServices.DirectorySearcher(entry);
>
>mySearcher.Filter = ("(samaccountname=rjameson)");
>
>-----------------------------
>
>Also, once I get the object back, how do I get the more obscure properties 
>from it. Like sn, and such.
>
>Thanks.
><>< Ryan
>
>---
>You are currently subscribed to dotnet as: [EMAIL PROTECTED]
>To unsubscribe send a blank email to %%email.unsub%%
>
>---------
>Administrated by 15 Seconds : http://www.15Seconds.com
>List Archives/Search : http://local.15Seconds.com/search
>Subscription Information : http://www.15seconds.com/listserv.htm
>Advertising Information: http://www.internet.com/mediakit/
>
>
>
>---
>You are currently subscribed to dotnet as: [EMAIL PROTECTED]
>To unsubscribe send a blank email to %%email.unsub%%
>
>---------
>Administrated by 15 Seconds : http://www.15Seconds.com
>List Archives/Search : http://local.15Seconds.com/search
>Subscription Information : http://www.15seconds.com/listserv.htm
>Advertising Information: http://www.internet.com/mediakit/
>
>
>
>---
>You are currently subscribed to dotnet as: [EMAIL PROTECTED]
>To unsubscribe send a blank email to %%email.unsub%%
>
>---------
>Administrated by 15 Seconds : http://www.15Seconds.com
>List Archives/Search : http://local.15Seconds.com/search
>Subscription Information : http://www.15seconds.com/listserv.htm
>Advertising Information: http://www.internet.com/mediakit/
>
>
>
>---
>You are currently subscribed to dotnet as: [EMAIL PROTECTED]
>To unsubscribe send a blank email to %%email.unsub%%
>
>---------
>Administrated by 15 Seconds : http://www.15Seconds.com
>List Archives/Search : http://local.15Seconds.com/search
>Subscription Information : http://www.15seconds.com/listserv.htm
>Advertising Information: http://www.internet.com/mediakit/


Robert Chartier
Author and Developer
604-975-5590
[EMAIL PROTECTED]
http://www.aspalliance.com/nothingmn/


---
You are currently subscribed to dotnet as: [EMAIL PROTECTED]
To unsubscribe send a blank email to %%email.unsub%%

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/



---
You are currently subscribed to dotnet as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

---------
Administrated by 15 Seconds : http://www.15Seconds.com
List Archives/Search : http://local.15Seconds.com/search
Subscription Information : http://www.15seconds.com/listserv.htm
Advertising Information: http://www.internet.com/mediakit/


Reply via email to