Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 26th, 2004, 07:47 AM
Friend of Wrox
 
Join Date: Jun 2003
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





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.