Hello,
I have the following code which queries all the users in an active
directory. I need to get the group name and users full name for each
user using c#.
Any help with code or a resource reference will of great help.
Thank you in advance.
private String adspath = "LDAP://dc=adserver,dc=netsweeper,dc=com";
private String username = "smanager";
private String password = "password";
private DBOperations dbdata ;
DirectoryEntry entry = new DirectoryEntry(this.adspath, this.username, this.password, AuthenticationTypes.Secure);
DirectorySearcher srch = new DirectorySearcher(entry);
//srch.SearchScope = SearchScope.Subtree;
srch.Filter = "(objectClass=User)";
foreach (SearchResult result in results)
{
if (result.Equals(null))
Console.WriteLine("Did not find any results");
else
Console.WriteLine("Initial find "+results.Count+" "+result.Path);
}
