Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching AD with VB 2005

Status
Not open for further replies.

siranthony

Programmer
Jan 31, 2008
10
US
I have some code that searches Active Directory with a DirectorySearcher. It returns a SearchResult. My question is, how can I find the node type (e.g., user or contact) that the SearchResult represents?

Here is some abbreviated code:


Dim mySearcher As New System.DirectoryServices.DirectorySearcher()
Dim myResult As System.DirectoryServices.SearchResult
...

For Each myResult In mySearcher.FindAll()
' Get the node type of myResult
...
Next
 
I've found the answer on my own. Here it is for reference...

SearchResult.GetDirectoryEntry.SchemaClassName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top