I am wanting to develop a staff directory application, listing all people in the organization, including name, email address, phone number, office location - all of that information. We currently have that in Active Directory, and I'm wanting to develop a simple .Net application to allow people to search and retrieve it. Getting the information appeared simple - there are many examples around using the DirectorySearcher class. I start with
Dim objADAM As DirectoryEntry ' Binding object.
Dim objGroupEntry As DirectoryEntry ' Group Results.
Dim objSearchADAM As DirectorySearcher ' Search object.
Dim objSearchResults As SearchResultCollection ' Results collection.
Dim strPath As String ' Binding path.
objADAM = New DirectoryEntry(strPath)
objADAM.RefreshCache()
objSearchADAM = New DirectorySearcher(objADAM)
objSearchADAM.Filter = "((&(objectClass=user)(objectCategory=person)))"
objSearchADAM.SearchScope = SearchScope.Subtree
objSearchResults = objSearchADAM.FindAll()
I then have a for each loop for each SearchResult Object in the objSearchResults set.
If objSearchResults.Count <> 0 Then
Dim objResult As SearchResult
For Each objResult In objSearchResults
objGroupEntry = objResult.GetDirectoryEntry
I also looked at all of the directory entry properties - the core properties are there, but if I use Active Directory Explorer to browser an actual user object, there are many more attributes listed. Is there some more complex structure to Active Directory that means I need to do more that just the simple FindAll method of a DirectorySearcher?
Thanks...