tags:

views:

41

answers:

1

I am a Database guy and dotnet novice who needs help with below UseCase

I am using LINQ to populate the DB but I am not sure how to insert/update ActiveDirectory using LINQ any sample code for doing that.

Most code samples on Google show how to query ActiveDirectory but not CRUD operations

+1  A: 

There's a "Linq-to-AD" project on CodePlex:

http://www.codeplex.com/LINQtoAD

That should hopefully do what you're looking for! So far, I've only ever seen it used to query the AD, however - don't know if it helps with inserting data.

If that doesn't help - check out these other resources:

If you're on .NET 3.5, go check out this MSDN article: Managing Directory Security Principals in the .NET Framework 3.5.

Otherwise check out this CodeProject article: Howto: (Almost) Everything In Active Directory via C#

Check out this list of Code Samples for System.DirectoryServices on MSDN.

If you're serious about Active Directory Programming in C# or VB.NET, go buy this book:

The .NET Developer's Guide to Directory Services Programming

alt text

Hope this helps!

Marc

marc_s
I'll second this from Marc--particularly the link to Managing Directory Security Principals in the .NET Framework 3.5. I *love* the System.DirectoryServices.AccountManagement namespace.
Jacob Proffitt