LDAP to Domain Controller

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mario

    #1

    LDAP to Domain Controller

    Hi,

    i am new on VB .net and i want to list all Active Directory Users in a WebInterface.
    It is no problem in Windows Applications to list users, but in Web Application i allay get the following error

    Server Error in '/IP-Phone-Admin' Application.
    --------------------------------------------------------------------------------

    The specified domain either does not exist or could not be contacted
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Runtime. InteropServices .COMException: The specified domain either does not exist or could not be contacted

    Source Error:


    Line 33: Dim result As System.Director yServices.Searc hResult
    Line 34: mySearcher.Filt er = "(ObjectClass=u ser)"
    Line 35: For Each result In mySearcher.Find All()
    Line 36: DropDown.Items. Add(result.GetD irectoryEntry() .Path)
    Line 37: Next


    Source File: C:\Inetpub\wwwr oot\IP-Phone-Admin\WebForm1. aspx.vb Line: 35

    Stack Trace:


    [COMException (0x8007054b): The specified domain either does not exist or could not be contacted]
    System.Director yServices.Direc toryEntry.Bind( Boolean throwIfFail)
    System.Director yServices.Direc toryEntry.Bind( )
    System.Director yServices.Direc toryEntry.get_A dsObject()
    System.Director yServices.Direc torySearcher.Fi ndAll(Boolean findMoreThanOne )
    System.Director yServices.Direc torySearcher.Fi ndAll()
    IP_Phone_Admin. WebForm1.Page_L oad(Object sender, EventArgs e) in C:\Inetpub\wwwr oot\IP-Phone-Admin\WebForm1. aspx.vb:35
    System.Web.UI.C ontrol.OnLoad(E ventArgs e)
    System.Web.UI.C ontrol.LoadRecu rsive()
    System.Web.UI.P age.ProcessRequ estMain()




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.432 2.573; ASP.NET Version:1.1.432 2.573

    I hope that anybody can help me
    thanx

    mario
  • Emil Kvarnhammar

    #2
    Re: LDAP to Domain Controller

    Hi,

    Please show the code where you create your DirectorySearch er.

    Looks like your web server can't find the domain controller of the domain
    you specify
    for the entry that you use to create your searcher with.

    regards
    Emil Kvarnhammar

    "Mario" <Mario@discussi ons.microsoft.c om> wrote in message
    news:107A4192-C1D2-487C-B7DC-CF8ECE93FA53@mi crosoft.com...[color=blue]
    > Hi,
    >
    > i am new on VB .net and i want to list all Active Directory Users in a[/color]
    WebInterface.[color=blue]
    > It is no problem in Windows Applications to list users, but in Web[/color]
    Application i allay get the following error[color=blue]
    >
    > Server Error in '/IP-Phone-Admin' Application.
    > --------------------------------------------------------------------------[/color]
    ------[color=blue]
    >
    > The specified domain either does not exist or could not be contacted
    > Description: An unhandled exception occurred during the execution of the[/color]
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.[color=blue]
    >
    > Exception Details: System.Runtime. InteropServices .COMException: The[/color]
    specified domain either does not exist or could not be contacted[color=blue]
    >
    > Source Error:
    >
    >
    > Line 33: Dim result As System.Director yServices.Searc hResult
    > Line 34: mySearcher.Filt er = "(ObjectClass=u ser)"
    > Line 35: For Each result In mySearcher.Find All()
    > Line 36: DropDown.Items. Add(result.GetD irectoryEntry() .Path)
    > Line 37: Next
    >
    >
    > Source File: C:\Inetpub\wwwr oot\IP-Phone-Admin\WebForm1. aspx.vb Line:[/color]
    35[color=blue]
    >
    > Stack Trace:
    >
    >
    > [COMException (0x8007054b): The specified domain either does not exist or[/color]
    could not be contacted][color=blue]
    > System.Director yServices.Direc toryEntry.Bind( Boolean throwIfFail)
    > System.Director yServices.Direc toryEntry.Bind( )
    > System.Director yServices.Direc toryEntry.get_A dsObject()
    > System.Director yServices.Direc torySearcher.Fi ndAll(Boolean[/color]
    findMoreThanOne )[color=blue]
    > System.Director yServices.Direc torySearcher.Fi ndAll()
    > IP_Phone_Admin. WebForm1.Page_L oad(Object sender, EventArgs e) in[/color]
    C:\Inetpub\wwwr oot\IP-Phone-Admin\WebForm1. aspx.vb:35[color=blue]
    > System.Web.UI.C ontrol.OnLoad(E ventArgs e)
    > System.Web.UI.C ontrol.LoadRecu rsive()
    > System.Web.UI.P age.ProcessRequ estMain()
    >
    >
    >
    >
    > --------------------------------------------------------------------------[/color]
    ------[color=blue]
    > Version Information: Microsoft .NET Framework Version:1.1.432 2.573;[/color]
    ASP.NET Version:1.1.432 2.573[color=blue]
    >
    > I hope that anybody can help me
    > thanx
    >
    > mario[/color]


    Comment

    • Mario

      #3
      Re: LDAP to Domain Controller

      Hi,
      thanx for your help

      ------------------------------------------------------------------
      Dim entry As New DirectoryServic es.DirectoryEnt ry("LDAP://ou=myusers,dc=n ts,dc=at")
      Dim mySearcher As New System.Director yServices.Direc torySearcher(en try)
      Dim result As System.Director yServices.Searc hResult
      mySearcher.Filt er = "(ObjectClass=u ser)"
      For Each result In mySearcher.Find All()
      DropDown.Items. Add(result.GetD irectoryEntry() .Path)
      Next
      --------------------------------------------------------------

      this code works fine in a windows application


      "Emil Kvarnhammar" wrote:
      [color=blue]
      > Hi,
      >
      > Please show the code where you create your DirectorySearch er.
      >
      > Looks like your web server can't find the domain controller of the domain
      > you specify
      > for the entry that you use to create your searcher with.
      >
      > regards
      > Emil Kvarnhammar
      >
      > "Mario" <Mario@discussi ons.microsoft.c om> wrote in message
      > news:107A4192-C1D2-487C-B7DC-CF8ECE93FA53@mi crosoft.com...[color=green]
      > > Hi,
      > >
      > > i am new on VB .net and i want to list all Active Directory Users in a[/color]
      > WebInterface.[color=green]
      > > It is no problem in Windows Applications to list users, but in Web[/color]
      > Application i allay get the following error[color=green]
      > >
      > > Server Error in '/IP-Phone-Admin' Application.
      > > --------------------------------------------------------------------------[/color]
      > ------[color=green]
      > >
      > > The specified domain either does not exist or could not be contacted
      > > Description: An unhandled exception occurred during the execution of the[/color]
      > current web request. Please review the stack trace for more information
      > about the error and where it originated in the code.[color=green]
      > >
      > > Exception Details: System.Runtime. InteropServices .COMException: The[/color]
      > specified domain either does not exist or could not be contacted[color=green]
      > >
      > > Source Error:
      > >
      > >
      > > Line 33: Dim result As System.Director yServices.Searc hResult
      > > Line 34: mySearcher.Filt er = "(ObjectClass=u ser)"
      > > Line 35: For Each result In mySearcher.Find All()
      > > Line 36: DropDown.Items. Add(result.GetD irectoryEntry() .Path)
      > > Line 37: Next
      > >
      > >
      > > Source File: C:\Inetpub\wwwr oot\IP-Phone-Admin\WebForm1. aspx.vb Line:[/color]
      > 35[color=green]
      > >
      > > Stack Trace:
      > >
      > >
      > > [COMException (0x8007054b): The specified domain either does not exist or[/color]
      > could not be contacted][color=green]
      > > System.Director yServices.Direc toryEntry.Bind( Boolean throwIfFail)
      > > System.Director yServices.Direc toryEntry.Bind( )
      > > System.Director yServices.Direc toryEntry.get_A dsObject()
      > > System.Director yServices.Direc torySearcher.Fi ndAll(Boolean[/color]
      > findMoreThanOne )[color=green]
      > > System.Director yServices.Direc torySearcher.Fi ndAll()
      > > IP_Phone_Admin. WebForm1.Page_L oad(Object sender, EventArgs e) in[/color]
      > C:\Inetpub\wwwr oot\IP-Phone-Admin\WebForm1. aspx.vb:35[color=green]
      > > System.Web.UI.C ontrol.OnLoad(E ventArgs e)
      > > System.Web.UI.C ontrol.LoadRecu rsive()
      > > System.Web.UI.P age.ProcessRequ estMain()
      > >
      > >
      > >
      > >
      > > --------------------------------------------------------------------------[/color]
      > ------[color=green]
      > > Version Information: Microsoft .NET Framework Version:1.1.432 2.573;[/color]
      > ASP.NET Version:1.1.432 2.573[color=green]
      > >
      > > I hope that anybody can help me
      > > thanx
      > >
      > > mario[/color]
      >
      >
      >[/color]

      Comment

      Working...