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

From: RickL (anonymous_at_discussions.microsoft.com)
Date: 05/27/04


Date: Thu, 27 May 2004 06:06:03 -0700

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