PC Review


Reply
Thread Tools Rate Thread

DirectorySearcher operations error

 
 
Shaun via .NET 247
Guest
Posts: n/a
 
      4th Aug 2004
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>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Operations error Tomas Microsoft ASP .NET 6 4th Apr 2006 05:40 PM
LDAP: Operations Error =?Utf-8?B?WXVyb2s=?= Microsoft Outlook Discussion 0 24th Feb 2005 08:41 PM
DirectorySearcher.FindAll() causes Unspecified Error in C# but not in VB.NET Dave Microsoft C# .NET 5 9th Nov 2004 07:39 AM
error using the PageSize property in DirectorySearcher object Mario Rodriguez Microsoft Dot NET 1 26th Mar 2004 07:59 AM
Global Operations Error, Please Help gwynpup Windows XP Help 0 7th Mar 2004 08:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:19 PM.