LINQ to Active Directory

I have found an amazing LINQ to AD open source assembly. Makes life for programming AD very easy here is a sample.

// NOTE: Entity type definition "User" omitted in sample - see samples in release.

var users = new DirectorySource<User>(ROOT, SearchScope.Subtree);

users.Log = Console.Out;

var res = from usr in users

where usr.FirstName.StartsWith("B") && usr.Office == "2525"

select new { Name = usr.FirstName + " " + usr.LastName, usr.Office, usr.LogonCount };

foreach (var u in res)
{

Console.WriteLine(u);u.Office = "5252";

u.SetPassword(pwd);

}

users.Update();

        
Look at how simple that is, if anyone is confused the var is an object created by the LINQ class so you just use it as any normal type. The good thing about this class is that changing any kind of property is very easy and straight forward.  Cool

If you don’t understand LINQ very well here is a URL for some help.

http://msdn.microsoft.com/en-us/netframework/aa904594.aspx

 

Download the LINQ to AD source

http://www.codeplex.com/LINQtoAD/Release/ProjectReleases.aspx?ReleaseId=8629

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

May 21. 2010 18:34

Designer handbags

It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!

Designer handbags

August 5. 2010 21:26

Internorm windows and doors

Appreciate what we have, that's what my mother always said to me.

Internorm windows and doors

August 7. 2010 01:22

rolex sales

Look forward to more post.<a href="http://www.luxrolex.com/swiss-rolex-watches-c-48.html">SWISS ROLEX watches</a>,<a href="http://www.replicarolex7.com/chopard-c-18.html">Chopard</a>,I've add your post to my twritter.

rolex sales

August 11. 2010 23:11

vigrx

this site is really great.. nice layout

vigrx

August 15. 2010 20:06

tinnitus remedies

Quite interesting blog post. Your current homepage is fairly quickly getting to be considered one of my favorite features.

tinnitus remedies

August 16. 2010 15:47

Premium Wordpress Themes

Pretty insightful post. Never thought that it was this simple after all. I had spent a good deal of my time looking for someone to explain this subject clearly and you’re the only one that ever did that. Kudos to you! Keep it up

Premium Wordpress Themes

August 17. 2010 18:49

Desmond Dinnocenzo

Hi. I genuinely liked reading through your current article!. High-quality material. I would undoubtedly recommend you to arrive up with articles a bit more frequently. By doing this, having this type of a useful weblog I really feel you'll rank higher within the search engines . I also subscribed to your Rss. Continue the great job!

Desmond Dinnocenzo

August 18. 2010 20:14

Cruz Macduffee

Hello, I stumbled across this web page by mistake when I was researching on Google then I wandered on your web site. I am forced to let you know that your site is really great I certainly like your design! Right now I have a good deal of free time to go through your blog so I saved it. I will be back before long. Thank you for this good website.

Cruz Macduffee

August 26. 2010 23:15

Josh Caho

This weblog seems to get a great deal of visitors. How do you promote it? It offers a nice unique spin on things. I guess having something authentic or substantial to say is the most important thing.

Josh Caho

August 28. 2010 00:11

Dee Marble

What a wonderful idea. I am not totally sure if that is true, but who knows. Would you be kind enough to write another post, but from the opposing vantage point.

Dee Marble

August 28. 2010 08:03

nude cam girls

dat komt alleen maar omdat de temperatuur stijgt... its just hard

nude cam girls

September 1. 2010 20:48

Cam Girls

I didn't see a hyperlink anywhere but do you sell ad space? I have several sites within the exact same specialized niche and I'd like to add my banner somwhere in your site.

Cam Girls

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



 

Dilbert of the day