473,395 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DirectorySearcher operations error

Hi there,

I have a problem with System.DirectoryServices.DirectorySearcher . I have a VB.Net Web Application containing a web form which has on it a text box, a list box and a button.
The form loads, user types part of a name into the text box and upon clicking the button fills the list box with AD usernames.
This works fine if I call the page from the web server, but if I call the page from a client machine (logged on as same user) when the button is clicked I recieve 'An operations error has occured' with one line highlighted.
Code snippet below, the line highlighted is the For Each... line.
The site is set up for windows authentication and the page initially loads, it is only when the button is pressed to do the search it fails.
Ideas anyone?

Thanks in advance.

Dim ADsrc As DirectorySearcher
Dim ADsrcResult As SearchResult
Dim ADsearchString As String = "(&(objectClass=user)(anr=" & txtSearchText.Text & "*))"
ADsrc = New DirectorySearcher(ADsearchString)
lstUsersFound.Items.Clear()
For Each ADsrcResult In ADsrc.FindAll()
Dim newitem As New ListItem
newitem.Text = ADsrcResult.Properties("Name")(0)
newitem.Value = ADsrcResult.Properties("samaccountName")(0)
lstUsersFound.Items.Add(newitem)
--------------------------------
IT Grunt

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>doJahhK5KE2DficSSLSgVA==</Id>
Nov 20 '05 #1
0 1200

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

Similar topics

1
by: Sezgin Rafed | last post by:
Hi everyone, I need to select Users from 2 Domains - one the User has logged into and a second one, which is a trusted Domain. There is no problem selecting Users from the Domain the User has...
5
by: Dave | last post by:
Hi All C# ADSI samples that I run cause unspecified errors. If I translate them into VB.NET they run fine. Here's an example: public string getEmail(string LDAPPath, string username) {...
4
by: cameron | last post by:
I have always been under the impression that LDAP was optimized for speed. Fast queries, fast access, slower writes. I have a block of data in LDAP and in SQL. Exact same data. The query is fast...
1
by: Jay | last post by:
I need to add a parameter to a directorysearcher.filter rather than using hard-coded text. I have the following code that finds all members of an AD group and then for each of those results tries...
0
by: Andrew124 | last post by:
Can anyone tell me why the code below returnes oX80005000 Unknown Error on W2K Advanced Server but doesn't work on W2K SBS: DirectoryEntry tmproot = new DirectoryEntry(ADPrefix +...
2
by: dhnriverside | last post by:
Hi I'm getting the following error in my code... "Exception Details: System.Runtime.InteropServices.COMException: The server does not support the requested critical extension" Here's the...
1
by: Tash | last post by:
I am having a weird problem. I am trying to use the following code to query active directory. Function IsExistInAD(ByVal loginName As String) As Boolean Dim userName As String =...
0
by: MJ | last post by:
Hi, On providing a DirectorySearcher object with a SearchRoot (Root Directory Entry where the search should begin), it is expected to search through the directory tree for objects which qualify...
1
by: nscarnati | last post by:
I have 2 containers with objects. The veterans container contains unique objects. Each of those objects can have 1 or more corresponding card objects in the cards container. VeteranCN is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.