Active Directory Utility for C#/ASP.Net

I've shown a couple of ways to interface with Active Directory but to be honest, most of them were rather basic at best. So I decided what was really needed was a basic utility class to help you, so I've come up with a couple of classes to help:

Directory.zip (2.73 kb)

This contains two files: Directory.cs and Entry.cs. Directory is the main object for connecting to your Active Directory setup, set up the search that you want to conduct, etc. It also comes with a couple of basic searches set up: get a user by user name, get all active users, and get all users. The last two can be modified further by entering your own sub filter, for example making sure they have an email address.

The second class is the entry class, which is the actual entry itself. I added some properties to help you find common things (email, phone, screen name, etc.) as well as a couple functions to help you out (Save, GetValue, and SetValue). So combined you should have enough of the functionality rolled up such that you can get started.

I will say that some functionality that I want in there is missing (entry creation/deletion, resetting/setting a user's password, etc.) and I'll add it prior to moving it over to my utility library but I think it's a decent start. Anyway, try out the code, leave feedback, and happy coding.

kick it on DotNetKicks.com   Shout it
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkListEmail

Posted by: James Craig
Posted on: 10/15/2008 at 10:24 AM
Tags: ,
Categories: C#
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed

Comments

Gut Instinct

Monday, May 03, 2010 3:52 PM

trackback

Scanning a Network for Computers in C#

Scanning a Network for Computers in C#

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading