Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2004

Tip: Looking for answers? Try searching our database.

LDAP Directory Entry Intermittent Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Neil - 07 Sep 2004 09:05 GMT
I have some code vb.net winforms, that works fine most of the time but stops working occasionally such as right now.
The code is this
Dim objDE As New DirectoryEntry("LDAP://" & DomainName)
       Dim objDS As DirectorySearcher = New DirectorySearcher(objDE)
       Dim results As SearchResultCollection

       Try
           objDS.Filter = "(objectClass=user)"
           'Find all users
           results = objDS.FindAll()

When the FindAll fails I get the error message
Error in Debug Mode
The server is not operational
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObjects()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindAll()
at /line in my code/

The value of 'domain name' is correct and is the W2k Domain server.
This works fine then stops working for a few hours then starts working again with no server downtime or changes.
Any ideas why the server is not operational message would appear?  I'm guessing its a network related issue

TIA
Jared - 11 Sep 2004 00:51 GMT
I've never had this problem! Are you at a remote site? Do you have a fast
connection? Do you have a large domain(s)?
Do you bind to a specific Domain Controller
(LDAP://MyDomainController/DC=Contoso,DC=com or just to the
defaultNamingContext (LDAP://DC=Contoso,DC=com)

FYI: (ObjectClass=User) will search for groups as well.
(&(objecClass=user)(objectClass=person)) is what I use most of the time. and
I only load the attributes that I will be using.
objDS.PropertiesToLoad.AddRange(New String() {"sAMAccountName", "cn", "sn"})
that seems to speed things up a bit as well.

>I have some code vb.net winforms, that works fine most of the time but
>stops working occasionally such as right now.
[quoted text clipped - 33 lines]
>
> <Id>nbnfIFee30OSktz/HCE9TA==</Id

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.