Hello All,
I'm attempting to retrieve users data from AD on an intranet application. If I pass the credentials through, it works fine; but, I don't want the user to have to retype in their login information.
This is how I declare my DirectorySearcher:
sName = User.Identity.Name
Dim entry As DirectoryEntry
entry = New DirectoryEntry("GC://dc=domain,dc=parent,dc=com")
Dim dsDirectorySearcher As New DirectorySearcher(entry)
* GC and LDAP are interchangeable, I've tried both. I've read that GC is the preferred method.
The rest of my search function:
dsDirectorySearcher.Filter = String.Format("(& (objectClass=*)(mailNickname={0}))", sName)
dsDirectorySearcher.SearchScope = SearchScope.Subtree
dsDirectorySearcher.PropertyNamesOnly = False
Dim srcSearchResults As SearchResult = dsDirectorySearcher.FindOne
I need to pull the users first and last name, department, email address and other public information that can be found using the address book.
As always, any and all help is greatly appreciated. Thank you in advance!!!