Click here to Skip to main content
13,452,991 members (50,864 online)
Click here to Skip to main content
Add your own
alternative version


34 bookmarked
Posted 28 Jan 2007

Working with Active Directory Application Mode(ADAM) in .NET 2.0

, 28 Jan 2007
Rate this:
Please Sign up or sign in to vote.


What is ADAM?

ADAM stands for Active Directory Application Mode. It provides a Directory Service on Windows 2003 server. It has a Lightweight Directory Access Protocol (LDAP) support to communicate with ADAM instance. It can also be integrated to Active Directory Federated Services (ADFS) in order to achieve single sign-on functionality. For more information on ADFS, see

Who should use ADAM?

ADAM should be used by those who don't want to setup the domain controller to enable directory services. Instead of this they can use ADAM. It is easy to install and maintain. Unlike other Active directories, you don't require a specialized professional to work with ADAM which results in lower cost.

Advantages of ADAM

  • Easy to deploy

    Developers and end users can easily deploy Active Directory Application Mode as a lightweight directory service on most Windows Server 2003 platforms and on Windows XP Professional. You can easily install, reinstall, or remove the ADAM application directory, making it the ideal directory service to deploy with an application.

  • Reduced costs

    By using a single directory technology for both your NOS and application directory, you can reduce overall infrastructure costs. Additional investments are not required for training, administration, or management of your application directory. Application programming interfaces (LDAP, Active Directory Service Interfaces (ADSI), and Directory Services Markup Language (DSML)) are also equivalent between the two directory services, so that you can build applications on ADAM and then migrate it to the corporate Active directory as needed, with minimal change.

  • Increased security

    Because Active Directory Application Mode is integrated with the Windows security model, any application that is deployed using ADAM can authenticate access against Active Directory across the enterprise.


  1. Consider a scenario in which a portal application must store personalization data that is associated with users who are authenticated by the NOS directory (Active Directory), but storing this personalization data in the NOS directory would require schema changes to the user class in the NOS directory. In this scenario, the application can use Active Directory for authentication and service publication while using Active Directory Application Mode to store user personalization data.


  2. Consider another scenario in which the system doesn't use Active directory to store user information. In such a scenario, Active Directory Application Mode is a perfect fit. Because ADAM can host user objects that are not Windows security principals but that can be authenticated using LDAP simple binds, all the user information, as well as authorization data for these applications can be stored in ADAM.


Accessing ADAM using .NET 2.0 (brief overview)

As mentioned earlier, an ADAM instance can be communicated using Lightweight Directory Access Protocol (LDAP). NET 2.0 uses ActiveDirectoryMembershipProvider class to access ADAM. This same class is being used to access Active Directory also.

Web.config settings:

<add name="ADAMConnectionString" 
        connectionString="LDAP://ServerName:389/OU=<place w:st="on" /><city w:st="on" />SSUsers</city />,<state w:st="on" />DC</state /></place />=SS_AT"/>

<membership defaultProvider="MyADAMMembershipProvider">
<add name="MyADAMMembershipProvider" 
  type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, 
  Version=, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" 
  connectionProtection="None" enableSearchMethods="true" 
  enablePasswordReset="false" requiresQuestionAndAnswer="false" 


  1. The server name is the name of the system on which ADAM is installed.
  2. Please make sure that the connectionUserName user must have Administrative rights. Otherwise you'll get an error if you try to create a user or change the password.

You can set the password policy for the ADAM users by setting following properties in the <providers> element of your Web.config file.

  1. minRequiredPasswordLength
  2. minRequiredNonalphanumericCharacters

Creating a user in ADAM</strong />

To create a new user in ADAM, you can use the following method. The syntax is:

Membership.CreateUser(string username, string pwd)

Accessing the currently logged in user

The GetUser() method of the Membership class is used to access the currently logged in User of ADAM. The syntax is:


This method has many other overloads. If you want to access any other user based on the username then, you can use this following overload: The syntax is:

Membership.GetUser(string username)

Changing the password of the ADAM user

To change the password of the ADAM user, you can use the following method. The syntax is:

Membership.Providers.ChangePassword(string username, 
                    string oldPwd, string newPwd)


I hope you got a brief overview of ADAM and how it can be accessed using .NET 2.0. In my next article, I'll present the extensive overview of working with ADAM using .NET 2.0 with sample code.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
India India
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
Mike Caddy10-Oct-13 2:43
memberMike Caddy10-Oct-13 2:43 
GeneralMy vote of 1 Pin
bobble793-Nov-10 12:12
memberbobble793-Nov-10 12:12 
Bad, very bad
GeneralHi Pin
Member 223332622-Apr-09 0:32
memberMember 223332622-Apr-09 0:32 
GeneralMy vote of 1 Pin
Ed K27-Mar-09 3:25
memberEd K27-Mar-09 3:25 
QuestionWhere should we give this commands ! Pin
G.Stanley John1-Sep-07 1:57
memberG.Stanley John1-Sep-07 1:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01-2016 | 2.8.180318.3 | Last Updated 28 Jan 2007
Article Copyright 2007 by Harsh_Nigam
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid