473,498 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The specified domain either does not exist or could not be contacted

I am new to .NET (and directory services) and I need to fill a drop down list box with the users of my company. I am trying to use the code shown below, but I get this error message when the line of code with the "For" statement runs: "System.Runtime.InteropServices.COMException: The specified domain either does not exist or could not be contacted
Can anyone give me any ideas as how to resolve this? Any and all help would be greatly appreciated. Thanks
Dim DirSearch As New DirectorySearcher(userDSE
DirSearch.SearchScope = SearchScope.Subtre
DirSearch.PropertiesToLoad.Add("name"
DirSearch.PropertiesToLoad.Add("mail"
DirSearch.Filter = "(objectcategory=user)
For Each sr As SearchResult In DirSearch.FindAll <-- ERROR OCCURS HER
Dim li As New ListIte
li.Text = sr.Properties("Name")(0
li.Value = sr.Properties("Name")(0
ddlReporter.Items.Add(li
Nex

Jul 21 '05 #1
2 14617
Rick,
If you receive an answer to this directly, please post back to the list. I
have been trying to resolve this very issue for some time now.
"RickL" <an*******@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
I am new to .NET (and directory services) and I need to fill a drop down list box with the users of my company. I am trying to use the code shown
below, but I get this error message when the line of code with the "For"
statement runs: "System.Runtime.InteropServices.COMException: The specified
domain either does not exist or could not be contacted" Can anyone give me any ideas as how to resolve this? Any and all help would be greatly appreciated. Thanks.

Dim DirSearch As New DirectorySearcher(userDSE)
DirSearch.SearchScope = SearchScope.Subtree
DirSearch.PropertiesToLoad.Add("name")
DirSearch.PropertiesToLoad.Add("mail")
DirSearch.Filter = "(objectcategory=user)"
For Each sr As SearchResult In DirSearch.FindAll <-- ERROR OCCURS HERE
Dim li As New ListItem
li.Text = sr.Properties("Name")(0)
li.Value = sr.Properties("Name")(0)
ddlReporter.Items.Add(li)
Next


Jul 21 '05 #2
You didn't specify where this code is running and your code doesn't show
where userDSE comes from. Since that is the object that is going to
determine the security context and LDAP server, that is the important part.

Is this running under ASP.NET? If so, these articles will help you:
http://support.microsoft.com/default...b;en-us;329986
http://msdn.microsoft.com/library/de...asp?frame=true

Also, I recommend you follow up in microsoft.public.adsi.general as that is
where the great majority of S.DS questions get fielded around here.

HTH,

Joe K.

"RickL" <an*******@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
I am new to .NET (and directory services) and I need to fill a drop down list box with the users of my company. I am trying to use the code shown
below, but I get this error message when the line of code with the "For"
statement runs: "System.Runtime.InteropServices.COMException: The specified
domain either does not exist or could not be contacted" Can anyone give me any ideas as how to resolve this? Any and all help would be greatly appreciated. Thanks.

Dim DirSearch As New DirectorySearcher(userDSE)
DirSearch.SearchScope = SearchScope.Subtree
DirSearch.PropertiesToLoad.Add("name")
DirSearch.PropertiesToLoad.Add("mail")
DirSearch.Filter = "(objectcategory=user)"
For Each sr As SearchResult In DirSearch.FindAll <-- ERROR OCCURS HERE
Dim li As New ListItem
li.Text = sr.Properties("Name")(0)
li.Value = sr.Properties("Name")(0)
ddlReporter.Items.Add(li)
Next


Jul 21 '05 #3

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

Similar topics

3
16418
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
0
1555
by: Kevin Buchan | last post by:
I have some code to query Active Directory group membership, based on an LDAP path. This works beautifully in my test exectuable, but when I try to move the class I built into an ASP.Net web...
1
4148
by: Brad | last post by:
I'm trying to use Active Directory to retrieve information for a user...for display purposes.. I am not using windows authentication or impersonation....I am using a fixed user id and password for...
1
1417
by: Sanmic | last post by:
I've made an .aspx page for managing Exchange 2000 mailboxes. Everything works fine when I uses "identity impersonate" in my web.config. If I disable Anonymous access in IIS and removes "identity...
2
5997
by: RickL | last post by:
I am new to .NET (and directory services) and I need to fill a drop down list box with the users of my company. I am trying to use the code shown below, but I get this error message when the line of...
2
4608
by: Phil Kelly | last post by:
Hi! I have an application that I have developed on a Win2K3 server using vb.net. The application binds itself to an LDAP provider, which is the name of an active directory domain, ie...
7
3866
by: John.NET | last post by:
Hi, First please forgive that this is a repost as the first time I didn't have my proper nospam email configured... I'm writing a web service where one method will launch another .NET program...
0
2960
by: Theon Greyjoy | last post by:
Hello, I'll admit up-front that I have very limited experience with Active Directory... I am using the Active Directory membership provider in my ASP.NET (C#) application. However, we do not...
0
4115
by: lsabster | last post by:
Hello, A user is getting an error: Message: 2760 SQL State: 42000 The specified schema name "TEST" either does not exist or you do not have permission to use it. How do I confirm that my...
0
7002
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
7203
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
7379
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...
0
5462
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4908
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
4588
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
3093
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
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.