E
egholm
I want to get a list of users from a specific AD group. I use this
code:
****************************************************************************************
SearchResult result;
DirectorySearcher search = new DirectorySearcher();
search.Filter = String.Format("(cn={0})", groupName);
search.PropertiesToLoad.Add("member");
result = search.FindOne();
ArrayList userNames = new ArrayList();
if (result != null)
{
for (int counter = 0; counter <
result.Properties["member"].Count; counter++)
{
string user = (string)result.Properties["member"][counter];
userNames.Add(user);
}
}
****************************************************************************************
When the code is finished user string = "CN=Egholm Jacob (DFDS
A/S),OU=Development,OU=IT,OU=DFDS AS,DC=dk,DC=dfds,DC=root"
But what I want to do is getting information like givenName,
displayName etc. from the user.
What shall I do?
code:
****************************************************************************************
SearchResult result;
DirectorySearcher search = new DirectorySearcher();
search.Filter = String.Format("(cn={0})", groupName);
search.PropertiesToLoad.Add("member");
result = search.FindOne();
ArrayList userNames = new ArrayList();
if (result != null)
{
for (int counter = 0; counter <
result.Properties["member"].Count; counter++)
{
string user = (string)result.Properties["member"][counter];
userNames.Add(user);
}
}
****************************************************************************************
When the code is finished user string = "CN=Egholm Jacob (DFDS
A/S),OU=Development,OU=IT,OU=DFDS AS,DC=dk,DC=dfds,DC=root"
But what I want to do is getting information like givenName,
displayName etc. from the user.
What shall I do?