Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8631615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:14:34+00:00 2026-06-12T09:14:34+00:00

I am trying to implement active directory authentication but I am getting exception which

  • 0

I am trying to implement active directory authentication but I am getting exception which is like

System.Runtime.InteropServices.COMException was caught
  Message=Unknown error (0x80005000)
  Source=System.DirectoryServices
  ErrorCode=-2147463168
  StackTrace:
       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
       at System.DirectoryServices.DirectoryEntry.Bind()
       at System.DirectoryServices.DirectoryEntry.get_AdsObject()
       at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
       at System.DirectoryServices.DirectorySearcher.FindOne()
       at ConsoleApplication1.ADAuthentication.AuthenticateADUsers(String userNameWithDomain, String password) in C:\Users\awadhendrat\documents\visual studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 83
       at ConsoleApplication1.Program.Main(String[] args) in C:\Users\awadhendrat\documents\visual studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs:line 23
  InnerException: 

I don’t know what I am missing. Following code I have written for implementing AD Authentication.

public bool AuthenticateADUsers(string userNameWithDomain, string password)
        {
            DirectoryEntry objDirectoryEntry = null;
            DirectorySearcher objDirectorySearcher = null;

            try
            {
                objDirectoryEntry = new DirectoryEntry("https://ab.hotels.com/", userNameWithDomain, password, AuthenticationTypes.Delegation);
                objDirectorySearcher = new DirectorySearcher(objDirectoryEntry);
                objDirectorySearcher.Filter = string.Format("(&(objectClass=user)(objectCategory=user) (sAMAccountName={0}))", userNameWithDomain.Substring(0, userNameWithDomain.IndexOf('@')));
                objDirectorySearcher.PropertiesToLoad.Add("msRTCSIP-PrimaryUserAddress");
                var result = objDirectorySearcher.FindOne();
                if (result != null)
                    return true;
                else
                    return false;                           
            }
            catch
            {
                throw;
            }
        }

I have done some google but not getting helpful. Here I have few confusion like every where they written LDAP://somedomain/ but here I have https://somedomain.com another confusion is my test application is on one domain and provided domain is on another server.

When I open links provided by client which is used for AD Authentication then it opens Open Office Web Access.

I don’t how to solve this problem.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:14:34+00:00Added an answer on June 12, 2026 at 9:14 am

    According to this answer (and some quick code I wrote to test this), it’s a permission problem (possibly related to your use of an https URL for the AD path, checkout this code for building a DirectoryEntry or the fact that you are doing a full AD search with the same user you are trying to authenticate).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use forms authentication with Active Directory but I need roles
I'm trying to implement a switch case statement like this: switch (active.attr('class')){ case video:
I am following the link http://geekswithblogs.net/frankw/archive/2008/05/18/forms-authentication-with-active-directory-in-asp.net-2.0.aspx Trying to implement the same in my application.I
I'm trying to implement basic http authentication, but I need to return different HTTP
I trying to implement the active record pattern using Java/JDBC and MySQL along with
I'm trying to implement one of active appearance models (AMM) and on one of
I'm trying implement A* Start path finding in my games(which are written with JavaScript,
Trying to implement a rating system of users and postings. What is the best
I'm trying to use a authenticate with an Active directory using Spring Security 3.1.
I'm trying to implement swiftmailer into this mailing system. my client has about 300k

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.