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
Scott Lackey
NA
1
2.4k
Directory Entry/ Directory Searcher question
Aug 1 2011 3:41 PM
Hello -
I am in a situation where I wish to gather information thru the Active Directory Domain:
DirectoryEntry entry = new DirectoryEntry();
entry.Path = "LDAP://DC=xxxx"
entry.AuthenticationType = AuthenticationTypes.Secure;
DirectorySearcher search = DirectorySearcher(entry);
search.PropertiesToLoad.Add("givenName");
search.PropertiesToLoad.Add("memberof");
search.PropertiesToLoad.Add("sAMAccountName");
SearchResultCollection result = search.FindAll();
So far everything works fine. Returns some 1163 entries. What I want to do now is loop through the entries and gather the individual values for givenName, memberof, etc.
foreach (SearchResult sr in result)
{
*****************************************
strName = sr.Properties["givenName"].ToString();
this statement stores the literal
"System.DirectoryServices.ResultPropertyValueCollection"
in the local string variable strName
***********************************
}
What the heck am I missing?
Thanks in advance...
Reply
Answers (
1
)
Not able to open asp.net proj on button click of windows application
Environment.HasShutdownStarted property in C#