1

We have a VB.NET application that uses LDAP to authenticate users through Active Directory.

Never had an issue before but this afternoon my co-worker applied Windows Updates and restarted our domain controller (and AD server) and now whenever anyone tries to login and use the application they get the following error:

Error Number: -2147016646

Error Descr: The server is not operational.

Using the following code to authenticate:

Dim adEntry As New System.DirectoryServices.DirectoryEntry("LDAP://" & gsDomainName, sUserName, sPassword)
Dim adSearcher As New System.DirectoryServices.DirectorySearcher(adEntry)

adSearcher.SearchScope = DirectoryServices.SearchScope.OneLevel

Try
    Dim adResults As System.DirectoryServices.SearchResult = adSearcher.FindOne
    ...

It fails on the adSearcher.FindOne piece of code.

The immediate window gives more detailed error information

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in System.DirectoryServices.dll

Anyone have any ideas?

Things I've tried:

  1. Flushing the DNS on the domain controller

  2. Restarting the DHCP server

  3. Restarting DNS services.

Thanks!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Tom
  • 4,467
  • 17
  • 59
  • 91
  • 1
    See [my response here](http://stackoverflow.com/questions/290548/validate-a-username-and-password-against-active-directory/499716#499716) - that should work on .NET 3.5 and newer – marc_s Apr 17 '13 at 18:29
  • 1
    I don't quite see how a C# implementation using the `System.DirectoryServices.AccountManagement` namespace would help the OP here. I'd suggest manually testing the login using ldp.exe and seeing if the same domain, username, and password still work against your current directory instance. That error typically means something in the client-configuration isn't able to resolve properly. Also, try Wiresharking the traffic to see if the initial connection is being reset or disbanded before `adSearcher` is able to process the search request. – X3074861X Apr 17 '13 at 20:52
  • A reboot of our domain controller seems to have fixed the problem. Still, a very strange and disturbing (in a developer's sense) issue. Hope it doesn't crop up again but I'll bookmark this question and re-open it should it happen again. – Tom Apr 18 '13 at 12:41

0 Answers0