Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 26th, 2004, 07:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default LDAP

Hello,

I'm trying to traverse the Active Directory structure, and the error that I'm getting is:

System.Runtime.InteropServices.COMException: The specified domain either does not exist or could not be contacted

Line 54: ShowEntry(ds.FindOne().GetDirectoryEntry())

The code is:

Dim ds As New DirectorySearcher
ds.SearchRoot = New DirectoryEntry("")
ds.Filter = "(|(&(objectCategory=user)(name=bmains)))"

ds.PropertyNamesOnly = True
ds.PropertiesToLoad.Add("name")
ds.CacheResults = True
ds.ReferralChasing = ReferralChasingOption.None
ds.Sort = New SortOption("name", SortDirection.Ascending)

'Was doing this, but this wasn't working either
'Dim srcColl As SearchResultCollection = ds.FindAll()
'For Each src As SearchResult In srcColl
' ShowEntry(src.GetDirectoryEntry())
'Next

'Erroring line; ShowEntry is a private method, but it's not even
'being called bacause the error occurs at ds.FindOne()
ShowEntry(ds.FindOne().GetDirectoryEntry())

'srcColl.Dispose()
ds.Dispose()

FYI I did import the System.DirectoryServices namespace. Now, this was working before, on another day. Could this be to a change on the network, or a network problem?

Thanks,

Brian
__________________
Brian
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP Authentication -- Need Help avinashraj General .NET 1 May 25th, 2006 12:13 AM
Help with using ActiveDirectory using LDAP aldwinenriquez General .NET 1 July 19th, 2005 02:16 AM
Access LDAP minhpx J2EE 0 June 14th, 2005 10:22 PM
Can I parse an LDAP DN? Kingster XSLT 1 July 30th, 2004 12:40 PM



All times are GMT -4. The time now is 08:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.