Introduction
The purpose of this very brief text is to present a simple class CActiveDirectoryUser
. This is a very easy to use C++ class in which you can simply list all the users in the ActiveDirectory by just a single function call. The code inside the class is very simple. It actually wraps some ADSI calls and can be easily understood.
Usage
CActiveDirectoryUsers ADUsers;
CStringArray Array;
bool res=ADUsers.GetADUsers(Array);
if(!Array.IsEmpty()&&res)
for(int i=0;i<Array.GetCount();i++)
{
CString strUser=Array.GetAt(i);
}
The function GetADUsers()
returns false in case of failure and returns true in case of success, so the CStringArray
contents will be only valid if the return value is true.
I have done masters in networks and e-business centred computing from The University of Reading, UK, Carlos III de Madrid, Spain and Aristotle University of Thessaloniki. Presently working in a London based software company as a senior software engineer. I like programming in C++, Java and C#, besides software development I spend my spare time in photography and music.
find me on facebook here
http://www.facebook.com/?ref=logo#!/profile.php?id=764610012