views:

106

answers:

3
+1  Q: 

Managed LDAP

Is there a managed API(C#) available for managing users and groups (CRUD operations) on Active Directory (AD) ?

(edit) I will give some more info why I asked this here. I am participating in a project where employee data in flat files (multiple .dat files) are written to a folder during 1 night scheduled job. These .dat files must be consolidated into 1 xml per employee. Each xml has enough information in it to perform CRUD operations on AD to get the AD in sync.

I was attentioned by a collegae that Microsoft Identity Integration Server (MISS) or the light-weight variant IILF can also be used for this.... is that possible in this scenario ?

(edit) Working with Visual Studio 2005 / .NET 2.0

+1  A: 

The System.DirectoryServices namespace provides easy access to Active Directory Domain Services from managed code.

Darnell
Yes, but it's quite limited in that it only supports a generic "DirectoryEntry" type. Check out the System.DirectoryServices.AccountManagement namespace in .NET 3.5 for MUCH BETTER support!
marc_s
+2  A: 

In .NET 3.5, there is System.DirectoryServices.AccountManagement

Code snippet:

   using (PrincipalContext ctx = GetPrincipalContext(domain, container))
   {
        using (UserPrincipal userPrincipal = UserPrincipal.FindByIdentity(ctx, username))
        {
           ...
        }
   }
Mitch Wheat
I forgot to mention that I work with Visual Studio 2005 / .NET 2.0
Patrick Peters
+1  A: 

There's an excellent MSDN article by Ethan Wilansky and Joe Kaplan (both AD MVP's and total gurus) which introduces these concepts very well.

Check it out here:

Managing Directory Security Principals in the .NET Framework 3.5

Highly recommended! The new System.DirectoryServices.AccountManagement namespace is available in .NET 3.5 and higher.

Marc

marc_s
+1. That is an excellent article
Mitch Wheat
I forgot to mention that I work with Visual Studio 2005 / .NET 2.0
Patrick Peters
Unfortunately, in that case, all you have is the System.DirectoryServices namespace, and the generic DirectoryEntry class - no specific implementations for User, Group etc.
marc_s