In this post, we will fetch Active Directory users using C# code. For this, all we need are Active Directory assemblies.
Before moving on let's understand some assemblies and classes associated with Active Directory which are used to perform some operations related to Active Directory.
Assemblies
using System.DirectoryServices;
Classes
PrincipalContext
DiectoryEntry
We have to use above assemblies for accessing and performing operation against Active Directory.
Add the following assemblies
Let's add the following class ClsUser with properties
Output
Closure
That's how we can fetch the Active Directory entries of user. Hope you find this helpful.
Happy coding!
Beginning ASP.NET in VB .NET: From Novice to Professional