Results 1 to 8 of 8

Thread: "An operations error occurred" error message while checking User in Active Directory

  1. #1
    Join Date
    Feb 2012
    Posts
    36

    "An operations error occurred" error message while checking User in Active Directory

    Last night while writing function to check User in Active Directory I was getting the error message:” An operations error occurred”. This my code :
    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;
    Code:
    SearchResult results = deSearch.FindOne(); //-->Error here
    
                if (results != null)
                {
                    return true;
                }
    
                return false;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
    When I tried to run Localhost it works very well without any error message but although when I connect to other PC I am getting the error. Can anyone please help.

  2. #2
    Join Date
    Jul 2011
    Posts
    235

    re: "An operations error occurred" error message while checking User in Active Directory

    Are you running IIS or Visual Studio, if you run Visual Studio all operation will be performed in the context of your windows user and while you deploy it to an IIS, you should configure credentials with which the AD should be accessed and this will not work properly with the box in IIS although if you change the web.config.

  3. #3
    Join Date
    May 2008
    Posts
    188

    re: "An operations error occurred" error message while checking User in Active Directory

    Try to put your code into a COM+ component and run it with a domain user's identity, use delegation (<identity impersonate="true" />). Run the process (IIS process or ASPNET process) as a domain user. Programmatically impersonate a domain user when necessary. Just go through all this and after that let me know.

  4. #4
    Join Date
    May 2011
    Posts
    296

    re: "An operations error occurred" error message while checking User in Active Directory

    Even I have faced this same issue and I have solved mine issue by unchecking anonymous access in the security settings for our web site in IIS and after that we won’t get any issue. Along with this I would also suggest you to check integrated security because this might be causing your web to run under the credentials.

  5. #5
    Join Date
    Oct 2011
    Posts
    80

    re: "An operations error occurred" error message while checking User in Active Directory

    I am also getting this same issue from one week and I not able to to figure out how to deal with. I have tried the steps given above to disable anonymous and enable impersonate in the IIS but after that also I am getting the same error message when site is at box. Can anyone help on this issue.

  6. #6
    Join Date
    Nov 2011
    Posts
    68

    re: "An operations error occurred" error message while checking User in Active Directory

    I think you need to remove the port number from the LDAP server ip address. When I read some article I have found sometime that the ports being dedicated and not being secure to process the invoke and the invoke is an set function. Along with this I would also suggest you to try to change the AppPool Identity for that application to Network Service and then you can solve your issue.

  7. #7
    Join Date
    Nov 2011
    Posts
    76

    re: "An operations error occurred" error message while checking User in Active Directory

    I have resolved this issue by opening the IIS7 and after that clicking on the Default Application Pool. Now on the Default Application Pool click on the Advanced Settings and under that set the Identity as Network Service. Now once you are done, restart the IIS and the error would be vanished immediately.

  8. #8
    Join Date
    Feb 2012
    Posts
    76

    re: "An operations error occurred" error message while checking User in Active Directory

    I was having the same issue. I was getting this error only after being deployed at webserver, it was working perfectly on my machine. I found that ,at server, in IIS, the Impersonation was checked with Window Authentication and by removing this impersonation in IIS, the error was gone.

Similar Threads

  1. Replies: 9
    Last Post: 01-11-2011, 04:44 PM
  2. Replies: 5
    Last Post: 30-10-2011, 06:42 AM
  3. "An error occurred throwing an exception" message in Firefox
    By Cedric in forum Technology & Internet
    Replies: 6
    Last Post: 19-06-2010, 09:16 AM
  4. "Directory Services cannot start" error message
    By Harend in forum Operating Systems
    Replies: 4
    Last Post: 23-12-2009, 04:01 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,687,828.61477 seconds with 17 queries