Re: The server is not operational

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 07/20/05

  • Next message: Dominick Baier [DevelopMentor]: "Re: Best Authentication Provider"
    Date: Wed, 20 Jul 2005 16:50:39 -0500
    
    

    The problem is likely in your _path variable (which you do not show). If you don't specify a domain or domain controller name in the path, the ADSI/S.DS tries to determine a DC via the current security context. However, if the current security context can't do that, you'll often get this error.

    Try a path like:
    LDAP://yourdomain.com/DC=yourdomain,DC=com

    instead of one like:
    LDAP://DC=yourdomain,DC=com

    If that doesn't fix it, you might have firewall issues preventing LDAP access or something.

    Additionally, remember that when you specify credentials in a DirectoryEntry bind, they will be sent on the network in cleartext (in 1.1. anyway) unless you specify authenticationtype.Secure or AuthenticationTypes.SecureSocketsLayer (which requires SSL/LDAP support in AD).

    HTH,

    Joe K.

      "CalSun" <calsun@gmail.com> wrote in message news:us3Q$dVjFHA.3568@tk2msftngp13.phx.gbl...
      Hi all,

      I really need your help on this problem. (no help for 1 day goolging).

      I use form authentication on my 2 simple aspx pages.
      User is redirected to login.aspx, then see the main content page.
      I use LDAP to verify the user from a domain named Dserver where the AD users locate.

      Everything works just fine on my laptop (localhost). I could verify the user from the Active Directory. I am also able to verify whether the user belongs to a group named AllowDogs and redirect accordingly (main content page or fail-message).

      Problem: As I move this application to an existing IIS win2k3 std box, I failed to verify user from the Dserver. I got the error message "The server is not operational"

      Here is my IsAuthenticated code:

      Public Function IsAuthenticated(ByVal domain As String, ByVal act As String, ByVal ps As String) As Boolean

      Dim domainAndAct As String = domain & "\" & act

      Dim entry As DirectoryEntry = New DirectoryEntry(_path, domainAndAct, ps)

      Try

      Dim obj As Object = entry.NativeObject

      Dim search As DirectorySearcher = New DirectorySearcher(entry)

      search.Filter = "(SAMAccountName=" & act & ")"

      search.PropertiesToLoad.Add("cn")

      Dim result As SearchResult = search.FindOne()

      If (result Is Nothing) Then

      Return False

      End If

      'update the path to the user in the directory

      _path = result.Path

      _filterAttribute = result.Properties("cn").Item(0)

      Catch ex As Exception

      'Throw New Exception("Error authenticating user: " & ex.Message)

      Return False

      End Try

      Return True

      End Function

      Thank you all for help/reading
      --CalSun


  • Next message: Dominick Baier [DevelopMentor]: "Re: Best Authentication Provider"

    Relevant Pages

    • Re: Slow LDAP Query
      ... Dim results = mySearcher.FindAll As SearchResultCollection ... ByVal name As String) As String ... >> queried from the directorySearcher into a DataSet's DataTable and bind ... >> directly bind the datatable to the DataGrid. ...
      (microsoft.public.dotnet.framework.performance)
    • Search pattern
      ... Dim strfile As String ... Dim bAddressFound As Boolean ... Dim strCurrentChar As String ...
      (comp.databases.ms-access)
    • Auto Write Name and Merge across
      ... Dim Sheetname01 As String ... Dim WeekName01 As String ...
      (microsoft.public.excel.misc)
    • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
      ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
      (microsoft.public.dotnet.framework.compactframework)
    • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
      ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
      (microsoft.public.dotnet.framework.compactframework)