TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kk m
NA
4
0
Get users's group information from Active Directory
Jan 16 2008 8:32 PM
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);
}
Reply
Answers (
4
)
regarding validation in c#
LDAP security policy enforcement