C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Microsoft Active directory Programming in C#


Posted Date: 23 May 2006    Resource Type: Articles    Category: .NET Framework
Author: Vikram Singh KshatriyaMember Level: Gold    
Rating: Points: 10



Introduction

Microsoft Technet offers a script repository to work with AD User Accounts; however, I needed to work with .NET and It needed to be programed to bind and access the Active Directory Functionality.The code samples I provide are written in C#.





Create a Connection to Active Directory-



///
/// Method used to create an entry to the AD.
/// Replace the path, username, and password.
///

/// DirectoryEntry
public static DirectoryEntry GetDirectoryEntry(){
DirectoryEntry diren = new DirectoryEntry();
diren.Path = "LDAP://192.168.41.11/CN=ctsa;DC=pune,DC=local";
diren.Username = @"ctsadomain\usesample";
diren.Password = "ctsa1234";
return diren;
}

2. Create a secure connection to Active Directory




/// Method used to create an entry to the AD using a secure connection.
/// Replace the path.
///
/// DirectoryEntry
public static DirectoryEntry GetDirectoryEntry(){
DirectoryEntry diren = new DirectoryEntry();
diren.Path = "LDAP://192.168.41.11/CN=Users;DC=ctsa,DC=local";
diren.AuthenticationType = AuthenticationTypes.Secure;
return diren;
}


Summary



However C# provides the System.DirectoryService.ActiveDirectory Namespace to use the functionality for Active Directory Programming .Using Active Directory as back end makes the application performance much better rather than using the database.Since Directory service provides the huge information all over the network with much reliablity than any database,
I have only posted the starting for Active Directory Programming and will continue with its next part.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Active directory Programming c#  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Deployment Steps for Windows Application
Previous Resource: Tracing
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use