473,513 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.DirectoryServices.SearchResult
Line 34: mySearcher.Filter = "(ObjectClass=user)"
Line 35: For Each result In mySearcher.FindAll()
Line 36: DropDown.Items.Add(result.GetDirectoryEntry().Path )
Line 37: Next
Source File: C:\Inetpub\wwwroot\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.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)
System.DirectoryServices.DirectoryEntry.Bind()
System.DirectoryServices.DirectoryEntry.get_AdsObj ect()
System.DirectoryServices.DirectorySearcher.FindAll (Boolean findMoreThanOne)
System.DirectoryServices.DirectorySearcher.FindAll ()
IP_Phone_Admin.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\IP-Phone-Admin\WebForm1.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

I hope that anybody can help me
thanx

mario
Nov 21 '05 #1
2 14552
Hi,

Please show the code where you create your DirectorySearcher.

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" <Ma***@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
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.DirectoryServices.SearchResult
Line 34: mySearcher.Filter = "(ObjectClass=user)"
Line 35: For Each result In mySearcher.FindAll()
Line 36: DropDown.Items.Add(result.GetDirectoryEntry().Path )
Line 37: Next
Source File: C:\Inetpub\wwwroot\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.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)
System.DirectoryServices.DirectoryEntry.Bind()
System.DirectoryServices.DirectoryEntry.get_AdsObj ect()
System.DirectoryServices.DirectorySearcher.FindAll (Boolean findMoreThanOne) System.DirectoryServices.DirectorySearcher.FindAll ()
IP_Phone_Admin.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\IP-Phone-Admin\WebForm1.aspx.vb:35 System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


-------------------------------------------------------------------------- ------ Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
I hope that anybody can help me
thanx

mario

Nov 21 '05 #2
Hi,
thanx for your help

------------------------------------------------------------------
Dim entry As New DirectoryServices.DirectoryEntry("LDAP://ou=myusers,dc=nts,dc=at")
Dim mySearcher As New System.DirectoryServices.DirectorySearcher(entry)
Dim result As System.DirectoryServices.SearchResult
mySearcher.Filter = "(ObjectClass=user)"
For Each result In mySearcher.FindAll()
DropDown.Items.Add(result.GetDirectoryEntry().Path )
Next
--------------------------------------------------------------

this code works fine in a windows application
"Emil Kvarnhammar" wrote:
Hi,

Please show the code where you create your DirectorySearcher.

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" <Ma***@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com...
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.DirectoryServices.SearchResult
Line 34: mySearcher.Filter = "(ObjectClass=user)"
Line 35: For Each result In mySearcher.FindAll()
Line 36: DropDown.Items.Add(result.GetDirectoryEntry().Path )
Line 37: Next
Source File: C:\Inetpub\wwwroot\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.DirectoryServices.DirectoryEntry.Bind(Boole an throwIfFail)
System.DirectoryServices.DirectoryEntry.Bind()
System.DirectoryServices.DirectoryEntry.get_AdsObj ect()
System.DirectoryServices.DirectorySearcher.FindAll (Boolean

findMoreThanOne)
System.DirectoryServices.DirectorySearcher.FindAll ()
IP_Phone_Admin.WebForm1.Page_Load(Object sender, EventArgs e) in

C:\Inetpub\wwwroot\IP-Phone-Admin\WebForm1.aspx.vb:35
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()


--------------------------------------------------------------------------

------
Version Information: Microsoft .NET Framework Version:1.1.4322.573;

ASP.NET Version:1.1.4322.573

I hope that anybody can help me
thanx

mario


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2759
by: Luca Bighi | last post by:
I try to use ldap-star-tls to connect to a win2003 domain controller and browse AD. $ds = ldap_connect("ldap://$ad_server/") ,"389"); // Connect to an LDAP server echo $debug?"<BR>LDAP...
1
1590
by: Michael Tkachev | last post by:
Hello All I would like to get all users from domain controller of windowsNT server 4.0 named "ruera03". This domain controller does not have an active directory. I cannot make the...
3
10781
by: John | last post by:
Does anyone know if there is a way to not use the server name in an LDAP path statement, like LDAP://SomeServer/... . We have multiple domain controllers and want the system to get an active domain...
7
5199
by: Sync Walantaji | last post by:
Hi, I would like to write a asp.net winform program to authenticate users on Active Directory. Can I do this with asp.net if the IIS server is not part of the Active directory domain? Is...
2
10722
by: Neil via .NET 247 | last post by:
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...
8
1337
by: BookerW | last post by:
I have the following line of code, but i don't think i am providing the right syntax: Dim oAllEntries As New DirectoryEntry(LDAP & LDAP_DOMAIN_SERVER & LDAP_USERS, LDAP_DOMAIN & sUserName,...
6
2993
by: Notgiven | last post by:
I am considering a large project and they currently use LDAP on MS platform. It would be moved to a LAMP platform. OpenLDAP is an option though I have not used it before. I do feel fairly...
2
4446
by: rufpirat | last post by:
Hello I'm in the middle of trying to build an "AD phone book", and this being my first try at asp.net, I have a few questions that I hope some of you might be able to help with: 1. Is it...
3
4020
by: RJN | last post by:
Hi I've written a code that queries Windows LDAP server and works fine, but the same doesn't work when querying Solaris LDAP server. DirectoryEntry de = new...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.