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 April 21st, 2005, 11:31 AM
Authorized User
 
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default error authenticating to active directory

Hi, I keep getting this error when I try to authenticate my windows form against our AD domain controller...

System.Runtime.InteropServices.COMException: The server is not operational

The source code that authenticates to our domain controller is:

    Dim _domain as String = "connect2.com"
    Dim _domainUID as String = "icadmin"
    Dim _domainPWD as String = "password"
    Dim _path As String
    Dim _login As String
    Dim _filterAttribute As String

    Public Function Authenticate(ByVal username As String, ByVal pwd As String) As Boolean
        Dim domainAndUsername As String = _domain & "\" & username
        Dim entry As DirectoryEntry = New DirectoryEntry("LDAP://" + _domain, username, pwd)

        Try
            'Bind to the native AdsObject to force authentication.
            Dim obj As Object = entry.NativeObject
            Dim search As DirectorySearcher = New DirectorySearcher(entry)

            search.Filter = "(SAMAccountName=" & username & ")"
            search.PropertiesToLoad.Add("cn")
            Dim result As SearchResult = search.FindOne()

            If (result Is Nothing) Then
                Return False
            End If

            'Update the new path to the user in the directory.
            _path = result.Path
            _login = username
            _filterAttribute = CType(result.Properties("cn")(0), String)
            Return True
        Catch ex As Exception
            Return False
        End Try

    End Function

I would really appreciate any help you can give me for this one!

Regards,
Marlon



 
Old April 23rd, 2005, 12:22 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

This is definetly some problem with connecting to the LDAP mentioned. Please check the LDAP name and also the username and password

Regards
Ganesh
 
Old June 2nd, 2005, 02:49 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I'm having the same problems with this.

I've checked LDAP name, user and password.
They're correct and i still keep getting that error.

FYI, I've enabled identity impersonation.
Do you any idea of how to solve this.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in authenticating web form gopi2008 ASP.NET 1.0 and 1.1 Basics 0 May 22nd, 2006 09:10 AM
About Active Directory apalmero VS.NET 2002/2003 1 November 9th, 2003 01:06 PM
Authenticating against Active Directory JamiebearT VB How-To 4 September 22nd, 2003 11:06 AM





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