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 3943494
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:47:19+00:00 2026-05-20T00:47:19+00:00

Hi I have an active directory that is installed on a machine that belong

  • 0

Hi
I have an active directory that is installed on a machine that belong to different domain than the domain I am doing development on.

And there is no trust relationship between the two domains.

Let’s say that domain called “test.com” .

there is an administrator called “test\administrator” with password “admin_password”

When I set up these setting with ActiveDirectoryMembershipProvider, I will be able to access, and login in to that Active directory and validate users.
I am using these settings

<configuration>
  <connectionStrings>
        <add name="ADService" connectionString="LDAP://test.com"/>
  </connectionStrings>
  <system.web>
     <compilation debug="true" targetFramework="4.0" />

      <authentication mode="Forms"> </authentication>

      <membership defaultProvider="AspNetActiveDirectoryMembershipProvider">
        <providers>
          <add name="AspNetActiveDirectoryMembershipProvider" connectionStringName="ADService" connectionUsername="test\administrator" connectionPassword="admin_password"
               type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
               connectionProtection="None" requiresUniqueEmail="false" enableSearchMethods="true" applicationName="/"/>
        </providers>
      </membership>
</configuration>

But when I try to write code from the same web app, or from another app , and try access the active directory from the code, I got error that login failed, unknown user name or password.

and this is my code

DirectoryEntry de = new DirectoryEntry("LDAP://test.com", "test\administrator", "admin_password", AuthenticationTypes.ServerBind);

            var ds = new DirectorySearcher(de) { Filter = string.Format("(&(objectClass=user)(sAMAccountName={0}))", "user1@test.com") };
            SearchResultCollection users = ds.FindAll();

I tried all types of AuthenticationTypes, and nothing worked
Any idea please

  • 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-05-20T00:47:19+00:00Added an answer on May 20, 2026 at 12:47 am

    I found out the problem
    it was very stupid
    the domain name should be capital , so the user name should be TEST\administrator

    I am surprised that the membership provider was able to deal with this.

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

Sidebar

Related Questions

I have a class that have three methods that have functionalities on Active Directory.
I have a server executable that talks to Active Directory to retrieve user information.
I have a web app that uses the Active Directory Membership Provider and when
We currently have a View that queries active directory info. I was wondering if
I have the following code that loads a user's Active Directory DirectoryEntry object from
I am querying information from Active Directory . I have code that works, but
We have ColdFusion and Active Directory running within the same domain. I'm trying to
I am currently using windows server 2008 machine. I have active directory and sharepoint
I have 3 computers. I have installed windows server + Active Directory on one
We have an application that uses Active Directory for its Authentication. This includes Kerberos

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.