Search code examples
asp.netactive-directoryasp.net-membershipadldap

Active Directory LDS Exception


Hey stack! I just installed a AD LDS instance in my development machine. The config is the following:

<membership defaultProvider="ActiveDirectoryProvider">
      <providers>
        <add name="ActiveDirectoryProvider" 
             connectionStringName="ActiveDirectoryConnection" 
             connectionUsername="CN=adldsadmin,CN=Users,CN=TestNet,DC=contoso,DC=com" 
             connectionPassword="123456" type="System.Web.Security.ActiveDirectoryMembershipProvider,System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"
             connectionProtection="None"
             enableSearchMethods="true"
             applicationName="App1" />
      </providers>
    </membership>

How ever I get the following exception:

The specified directory service attribute or value does not exist.

The adldsadmin user is in all of the groups. What am I doing wrong?

Thanks!


Solution

  • Okay, I found what the problem was. Apparently something to do with authentication. The solution is:

    1. Open the command prompt in administrator mode.
    2. Type cd %windir%
    3. Type dsmgmt and press enter.
    4. Type the following commands pressing enter after each line:

      ds behavior
        connections
          connect to server localhost:389
          quit
        allow passwd op on unsecured connection
        quit
      

      quit

    Now it should work.