Help me error "An operations error occurred" !

 Hi!

 I am trying write function to check User in Active Directory 

This my code :

        try
        {
            DirectoryEntry de = new DirectoryEntry("LDAP://myDomain");
            DirectorySearcher deSearch = new DirectorySearcher();
            deSearch.SearchRoot = de;

            deSearch.Filter = "(&(objectClass=user)(sAMAccountName=" + userName + "))";
            deSearch.SearchScope = SearchScope.Subtree;
            SearchResult results = deSearch.FindOne(); //-->Error here

            if (results != null)
            {
                return true;
            }

            return false;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
When I run on Localhost (with IP : 192.168.0.67) it very well, but I get other PC (in the same domain with IP : 192.168.0.68) connect to PC (192.168.0.67)
eg: http://192.168.0.67/website/Login.aspx
It throw exception :   "An operations error occurred"
* Note this my webconfig file
web.config :
....
<authentication mode="Windows"/>    
<identity impersonate="true"/>
.... 
 I don't know why? Please help me! Thank you very much!
0
phanhoangduc
6/25/2008 3:36:06 AM
asp.net.active-directory-ldap 2291 articles. 0 followers. Follow

3 Replies
1588 Views

Similar Articles

[PageSpeed] 32

Are you running in IIS or in Visual Studio? When you run in Visual Studio, all AD operations will be performed in the context of your windows user. When you deploy it to an IIS, you need to configure the credentials with which the AD should be accessed. It will not work out of the box in IIS, even if you change web.config. Read Ryan Dunn's Common System.DirectoryServices Issues and Solutions to get an overview of the options you have.


If this post was useful to you, please mark it as answer. Thank you!
0
johram
6/25/2008 11:18:37 AM

 Thank for reply !

I use IIS5

I read dunnry's article but I don't understand

Q:  How can I get my code running on the web then?
A:
  You have a variety of options, some better than others:
     1. Explicitly specify credentials on the DirectoryEntry - use the constructor or .Username and .Password (don't forget your AuthenticationTypes.Secure).


     2. Put your code into a COM+ component and run it with a domain user's identity  <----- I don't understand here


     3. Use delegation (<identity impersonate="true" />).
     4. Run the process (IIS process or ASPNET process) as a domain user.  This means setting an App Pool identity in IIS6 or changing the Anonymous account in IIS5 and using impersonation.
     5. Programmatically impersonate a domain user when necessary.

Could you tell me about it. If possible send for me a small sample.

Thank you very much.

 

0
phanhoangduc
6/26/2008 1:24:26 AM

Easiest thing to do is to simply uncheck anonymous access in the security settings for your web site in IIS and also make sure you check integrated security. This will cause your web to run under the credentials of the visiting domain user, and subsequent AD calls will run in the same context.


If this post was useful to you, please mark it as answer. Thank you!
0
johram
6/30/2008 2:26:12 PM
Reply:

Similar Artilces:

Error "An operations error occurred"
Dear All, Appreciate if anyone of you can guilde me on this. We encounted the problem “An operations error occurred” when we are submitting the “CreateDistributionList” procedure in “Hosted Exchange” namespace. This procedure used to be working before, but now it is having problem. Perhaps, something that has triggered the problem. Any feedback is appreciated. Thanks in advance, Chun Chai Can you provide more information? I do not know off hand what might cause that but if you post some more info, and I would suggest tracing the request using traceview in the MPS resource...

Help on Error message: "An error occurred while try to load the string resources (GetModuleHandle failed with error "
Hi I have compiled my project in VS.NET (ASP.NET web application in C#) without any build errors. This was in the process of establishing a local setup using the files from the deployed server. Now after copying all the relevant files and compiling them, when I try to browse from IIS (inetmgr) with an appropriate start page (Login.aspx), I get the following error message: An error occurred while try to load the string resources (GetModuleHandle failed with error -2147023888). Description: An unhandled exception occurred during the execution of the current web request. Please revie...

Login Error message "A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1
 Hi all, I was wondering if any body know anything about this problem I'm getting with the login program?Thanks in advance.  A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation) 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.Data.SqlClient.SqlException: A transport-level...

superreview requested: [Bug 390160] "Out of memory" and " Nothing active on context" errors in Error console
Blake Kaplan <mrbkap@gmail.com> has asked Brendan Eich <brendan@mozilla.org> for superreview: Bug 390160: "Out of memory" and "Nothing active on context" errors in Error console https://bugzilla.mozilla.org/show_bug.cgi?id=390160 Attachment 274726: Proposed fix https://bugzilla.mozilla.org/attachment.cgi?id=274726&action=edit ------- Additional Comments from Blake Kaplan <mrbkap@gmail.com> This patch should fix this bug by not calling JS_GetScopeChain if there's no JS on the stack. ...

superreview granted: [Bug 390160] "Out of memory" and " Nothing active on context" errors in Error console
Johnny Stenback <jst@mozilla.org> has granted Blake Kaplan <mrbkap@gmail.com>'s request for superreview: Bug 390160: "Out of memory" and "Nothing active on context" errors in Error console https://bugzilla.mozilla.org/show_bug.cgi?id=390160 Attachment 274847: Another attempt https://bugzilla.mozilla.org/attachment.cgi?id=274847&action=edit ...

superreview canceled: [Bug 390160] "Out of memory" and " Nothing active on context" errors in Error console
Blake Kaplan <mrbkap@gmail.com> has canceled Blake Kaplan <mrbkap@gmail.com>'s request for superreview: Bug 390160: "Out of memory" and "Nothing active on context" errors in Error console https://bugzilla.mozilla.org/show_bug.cgi?id=390160 Attachment 274726: Proposed fix https://bugzilla.mozilla.org/attachment.cgi?id=274726&action=edit ------- Additional Comments from Blake Kaplan <mrbkap@gmail.com> This even innerizes, which makes sense from an API standpoint -- if the global object doesn't have an innerObject hook (as it would be...

Unhadled Error: "An Error has Occurred"
Hi,After recompiling my DNN 3.2.0 (All clean). I FTPed the resulting set of DLLs up to my webserver overwriting the originals.I now get :Default.aspx?tabid=36&error=Object+reference+not+set+to+an+instance+of+an+object.&content=0with the term :An error has occurredAn error has occurredTotal panic as this is a live site!!! Can anyone help???...

superreview requested: [Bug 390160] "Out of memory" and " Nothing active on context" errors in Error console #2
Blake Kaplan <mrbkap@gmail.com> has asked Johnny Stenback <jst@mozilla.org> for superreview: Bug 390160: "Out of memory" and "Nothing active on context" errors in Error console https://bugzilla.mozilla.org/show_bug.cgi?id=390160 Attachment 274847: Another attempt https://bugzilla.mozilla.org/attachment.cgi?id=274847&action=edit ------- Additional Comments from Blake Kaplan <mrbkap@gmail.com> This even innerizes, which makes sense from an API standpoint -- if the global object doesn't have an innerObject hook (as it would be for most em...

superreview granted: [Bug 390160] "Out of memory" and " Nothing active on context" errors in Error console #2
Blake Kaplan <mrbkap@gmail.com> has granted superreview: Bug 390160: "Out of memory" and "Nothing active on context" errors in Error console https://bugzilla.mozilla.org/show_bug.cgi?id=390160 Attachment 274862: With comment https://bugzilla.mozilla.org/attachment.cgi?id=274862&action=edit ------- Additional Comments from Blake Kaplan <mrbkap@gmail.com> Waiting on the tree to open again to check this in. ...

superreview granted: [Bug 390160] "Out of memory" and " Nothing active on context" errors in Error console #3
Blake Kaplan <mrbkap@gmail.com> has granted superreview: Bug 390160: "Out of memory" and "Nothing active on context" errors in Error console https://bugzilla.mozilla.org/show_bug.cgi?id=390160 Attachment 274863: Updated patch https://bugzilla.mozilla.org/attachment.cgi?id=274863&action=edit ------- Additional Comments from Blake Kaplan <mrbkap@gmail.com> This API is only used in a couple of places, and this patch does the right thing for both of those places. This will allow errors to be reported properly in more cases. ...

[ID 20000620.005] MM_Win32, pm_to_blib section causing "Error -- Expecting macro or rule defn," then "Error -- rem: No such file or directory"
To: perlbug@perl.com Subject: MM_Win32, pm_to_blib section causing "Error -- Expecting macro or rule defn," then "Error -- rem: No such file or directory" Reply-To: an400@ncf.ca This is a bug report for perl from an400@ncf.ca, generated with the help of perlbug 1.28 running under perl v5.6.0. This error is occurring in all my generated makefiles. Commands executed: 1) perl makefile.pl verb verb cc=gcc lib=d:/server/lib 2) dmake -f makefile -v output ends at : DMAKE.EXE: makefile: line 650: Error -- Expecting macro or rule defn, found neither D...

"Error Group: WINSOCK" "Error Code:11004"
Hi Just setup iPrint on the server and tried to install the printer to the laptop and got the following message: Error code:11004 Error message: Winsock 11004 - The DNS name has been found in the database, but its associated data is not correct. Error group: WINSOCK Error code:11004 Anyone know what associated data it is referring to? Thanks in advance -- iangh2 A quick Google found this on http://www.sockets.com/err_lst1.htm WSANO_DATA (11004) Valid name, no data record of requested type Berkeley description: The requested name is valid, but does not hav...

Help with "validateRequest" .NET error
Can anyone identify how to fix this error. This happens when attempting to Save editted text in any module.Where do you set validateRequest=false ??? Server Error in '/dotnetnuke/myapp' Application. -------------------------------------------------------------------------------- A potentially dangerous Request.Form value was detected from the client (_ctl0:txtDesktopHTML="<SPAN class=Normal> ..."). Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate...

Crystal Report Viewer Error: "CRAXDRT Error Occured on Server. 507 : An Exception Occured"
We have recently setup Window Server 2003 SP2 (IIS V6.0) with Crystal Report 8.5 installed. All things working well for report viewer in internet browser, but only the problem is when user trying to export report to a file (CR/word/rich text/etc format) will hit the error:CRAXDRT Error Occurred on Server. 507 : An exception occurredOnly option is click "OK" to continue... Well, so we just click "OK" and try again... Note that, for second tried onward will hit another error:CRAXDRT Error Occurred on Server. 70 : Permission deniedIt was annoying us as export ...

.."an unexpected error occurred on a send/receive" error
Hi, I have a client (w2ksrv) that makes calls to a web service (w2k3) and occasionally I was receiving the following error: "The underlying connection was closed, an unexpected error occurred on a receive" This only seemed to happen after the web service had been left idle for +1hr. After scouring several newsgroup posts on google I found one where someone at Microsoft recommend turning http keep-alives off. I did this by overloading the GetWebRequest of my proxy class and this appeared to resolve the issue.. until 5 mins ago, when I received this error: "The under...

Network Error (tcp_error) A communication error occurred: ""
hi all am using a visualstudio 2005 web application(VB) with sql 2008 as backend. my reports in this web application working based on the sql 2008 stored procedures.. when i have lot of records in reports it is giving me an error as follows ********************** Network Error (tcp_error) A communication error occurred: "" The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time. For assistance, contact your network support team. **********************  if the number of ...

Getting "No error" instead of "No such file or directory" on Win32
Hi all, in this CPAN testers XML-LibXML test failure: http://www.cpantesters.org/cpan/report/d9cf95fc-d5e8-1017-8e8a-88a105085451 I am getting this: [QUOTE] t/01basic.t ......................... ok # Failed test 'error parsing non-existent does_not_exist.xml' # at t/02parse.t line 238. # 'Could not create file parser context for file "does_not_exist.xml": No error at t/02parse.t line 237. # ' # doesn't match '(?-xism:\ACould not create file parser context for file "does_not_exist\.xml": No\ such\ file\ or...

Compilation Error: The Type 'Microsoft.LearningComponents.Framesets.TOCHelper' exists in both "directory" and "directory"
Hi there, I'm having a problem at the moment with compiling my web application, the application is inheriting the above-mentioned type from two places.  The error message is as follows Error 1 The type 'Microsoft.LearningComponents.Frameset.TocHelper' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\Microsoft.SharePointLearningKit\1.3.0.2__24e5ae139825747e\Microsoft.SharePointLearningKit.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\basicwebplayer\92b06721\32e9e029\App_Code.ax8qo3m_.dll'   I've tried d...

Operating system error 5: "5(error not found)"
Im getting an error when I go to load a page after editing (adding extra tables) the aspnetdb database (in both firefox and IE), Visual Web Developer sees the database when I want to edit it and have no problems playing with it, it is just when I go to load the page that im getting a problem, if I delete the aspnetdb.mdf and aspnetdb.ldf files from the App_Data folder and load a page there is not a problem but i need to access these extra tables, im running vwd beta2 and sql express beta 2. There is also no problem when using the "Website->ASP.NET Configuration" app to add new us...

ADO "Multiple-step operation generated errors" error
I am migrating from Delphi 2007 to Delphi 2009 (June2009). I have them both concurrently installed on my machine during the migration. With the following code: With FFeedDataset Do Begin Active:=False; CommandText:='Select * From '+FeedsTableName; Active:=True; If Locate('ID',InFeed.ID,[]) Then Edit Else Insert; FieldByName('Title').AsString:=InFeed.Title; FieldByName('Enabled').AsBoolean:=InFeed.Enabled; FieldByName('Hidden').AsBoolean:=InFeed.Hidden; (and etc.) Post; End;//With FeedsDataSet When I post, I get the "Multiple-step operation generated errors" wth D2009, no error with D2007. What little I have seen about this error suggests data constraint validations, etc. But If the data I am posting is good enough for D2007, why not for D2009? "Ken Lange" wrote in message news:125681@forums.codegear.com... > CommandText:='Select * From '+FeedsTableName; > Active:=True; > If Locate('ID',InFeed.ID,[]) Then While this does not directly address the error you are reporting, it might fix it anyway - why are you selecting *all* records just to look for and edit one ...

Unknown kernel error "operating system error 64"
Hi, I have a problem on an ASE 12.5.2 server (server not responding anymore, not even to dsedit "ping"), for which I can't find any documentation. In server log, we could find the events below, which triggers several questions: What are those "operating system error 64 & 121"? We don't have a "'e:\ase1252\" folder on this server, why is it refering to it? We couldnt find any related errors in Windows 2000 event log, can anyone help? Errorlog extract: .. 00:00000:00012:2005/07/27 04:34:51.39 kernel NT operating system error ...

"An IO error has occurred writing to the exception log" Error
I'm getting this error intermittently. Anyone have any ideas why? I have the log folder security in the _default portal set to full for the aspnet user. I've also added the Network group as well with full access. Do I need a Network user? Any help on this would be appreciated. Thanks 1. Are you running Win2000 or Win2003? 2. Is it possible that the file is marked as READ-ONLY? DanDotNetNuke Core Architect 1. I'm running Windows 2000 server 2. No the files are not set as read-only I should clarify this..... dotnetnuke\portals\_default\logs None of the files in this fol...

VS .net error
Hi Anybody experienced this problem...? The intelligence has gone from my Visual Studio .Net 2003... help All the coloring has despaired from my code - apart from the comments which are still green. The intelligence is not working... I dont get any suggestions on what to use. I cant use the undo - I only get this error: Unknown undo/redo error I have search on the internet, but I havent managed to find an answer to why this is happening... When I build the application I get the coloring back, but as soon as I try and change something in the code it all goes again.. ...

Help with "The instruction at"0x111fd0d5..." error
OK, I'm stumped! I've been working in PB7 for 2 years now, and I have never seen this error until last week. I was working on a new data window, connecting to an ODBC universe source. All of a sudden I get: "The instruction at"0x111fd0d5" referenced memory at "0x00000001". The memory could not be "read"." now I get the error when I try and open the library painter. Weird thing is, I get the same error when I try and open a clean saved version of the library that I used to compile years ago! I formatted a new hard drive and set up PB ...

Web resources about - Help me error "An operations error occurred" ! - asp.net.active-directory-ldap

Resources last updated: 3/14/2016 4:57:43 PM